django-db-performance
Installation
SKILL.md
Django DB Performance
Use this as the orchestration skill for Django database performance work. Start with measured evidence, reproduce the slow path, and route to the smallest optimization that changes the measured bottleneck.
Core Workflow
-
Capture the symptom.
- Identify the exact endpoint, command, task, report, or queryset.
- Record current wall-clock time, query count, slow SQL, database backend, data volume, and Django version.
- Keep the original request parameters or fixture that reproduces the issue.
-
Profile before changing code.
- Use APM traces, database slow-query logs, Django Debug Toolbar,
connection.queries, or targeted logging. - If the expensive query is known, use
QuerySet.explain()or databaseEXPLAIN. - For API endpoints, profile serializers and permission checks as well as querysets.
- Use APM traces, database slow-query logs, Django Debug Toolbar,