django-queryset-batch-processing

Installation
SKILL.md

Django QuerySet Batch Processing

Use this skill when Django code processes many rows. The goal is to avoid loading unnecessary model instances, avoid queryset result-cache blowups, and move writes into set-based database operations when behavior allows.

Workflow

  1. Identify the per-row work.

    • Is it read-only export/reporting?
    • Does it need model methods, validation, or signals?
    • Can the database compute or update the value directly?
  2. Choose the read pattern.

    • Use values() or values_list() for scalar exports and reports.
    • Use iterator(chunk_size=...) when model instances are needed but queryset caching is not.
    • Keep ordering deliberate; unnecessary ordering costs work.
Installs
46
Repository
lvtd-llc/skills
GitHub Stars
1
First Seen
Jun 21, 2026
django-queryset-batch-processing — lvtd-llc/skills