Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimizes large Django queryset reads and writes using chunking, values, and bulk operations.
95% 100%+5 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
3 of 3 safety checks passed
186 agent runs
2 forksA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
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.
Identify the per-row work.
Choose the read pattern.
values() or values_list() for scalar exports and reports.iterator(chunk_size=...) when model instances are needed but queryset caching is not.Choose the write pattern.
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.Control batch size.
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.
Next to this one in the catalogue, plus more from the same author.