lvtd-llc/skills

django-queryset-batch-processing

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.

First seen Jun 21, 2026

Installation

$ npx skills add lvtd-llc/skills --skill django-queryset-batch-processing

Summary

  • 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.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from lvtd-llc/skills · top by installs.

npx skills add lvtd-llc/skills

Browse all from lvtd-llc/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version0.1.0
LicenseMIT
CompatibilityCodex, Claude Code, and other Agent Skills-compatible clients.
Declared agents claude-code codex
More metadata
version
0.1.0
displayName
Django QuerySet Batch Processing
category
Django
tags
django,querysets,batch-processing,orm,performance

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,414 B
  • docs SUMMARY.md 385 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 58 installs

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?

  1. Choose the read pattern.

- Use values() or valueslist() for scalar exports and reports. - Use iterator(chunksize=...) when model instances are needed but queryset caching is not. - Keep ordering deliberate; unnecessary ordering costs work.

  1. Choose the write pattern.

- Use QuerySet.update() with F() or expressions for uniform updates. - Use bulkupdate() when each object has a different value. - Use bulkcreate() for inserts, with conflict options only when the project supports their semantics. - Fall back to per-instance save() only when hooks, validation, side effects, or signals are required.

  1. Control batch size.

- Keep transactions bounded. - Avoid huge IN lists and oversized CASE updates. - Monitor locks, replication lag, and memory for production jobs.

See [batch-patterns.md](references/batch-patterns.md) for examples and caveats.

Safety Notes

  • Bulk update/delete operations do not call each model instance's save() or delete() methods.
  • Bulk operations can skip application-level side effects and signals.
  • Long transactions can hold locks and delay vacuum or replication.

Verification

Measure rows processed per second, query count, memory, transaction duration, and correctness on a representative batch.