Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Process large Django querysets and write-heavy jobs with memory-safe reads, values/values_list, iterator chunking, set-based update/delete, bulk_create, bulk_update, F expressions, Func expressions, and batch sizing. Use when a Django command, task, migration, report, or loop reads or writes many rows and is slow, memory-heavy, or query-heavy.
.claude/skills/hashgraph-online-django-queryset-batch-processing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-16 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-12 | ✓→✓ | = Same ✓ | -29% | 0% |
| case-01 | ✓→✓ | = Same ✓ | -20% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 10% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 6% | 0% |
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.
values() or values_list() for scalar exports and reports.iterator(chunk_size=...) when model instances are needed but queryset caching is not.QuerySet.update() with F() or expressions for uniform updates.bulk_update() when each object has a different value.bulk_create() for inserts, with conflict options only when the project supports their semantics.save() only when hooks, validation, side effects, or signals are required.IN lists and oversized CASE updates.See batch-patterns.md for examples and caveats.
save() or delete() methods.Measure rows processed per second, query count, memory, transaction duration, and correctness on a representative batch.
Other measured skills in the registry, with their headline benchmark lift.