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.
SkillScore100Maintained
Automatic
◆Coding pack
Last verified 8/16/2026
What it changes
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
Without skill95%
With skill100%
Checks it passed that the model alone missed
Recommends batching or chunking the list of objects before passing them to bulk_update.
1 fixed21 passed either way0 still failing0 broke
Pass-rate lift
+5 pp
Tokens
-4%
Agent turns
0%
Response time
-27%
Model gemini-3.6-flashMeasured 8/16/2026v122 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
A developer executes `UserProfile.objects.bulk_update(user_list, ['score'])` where `user_list` contains 250,000 instantiated model objects. The database driver throws an operational error due to excessive parameter count in the generated SQL string. How should the application code structure the bulk update execution?
What was checked, without and with the skill
Checked
Without skill
With skill
Recommends batching or chunking the list of objects before passing them to bulk_update.
Missed
Passed
case-16 · gemini-3.6-flash · 8/16/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md38 lines2 files
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
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?
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.