audit-database-performance
Skill4 starsChanged 2 months agoMITView on GitHub
Audit database-backed application code for missing indexes, unbounded result sets, missing pagination, expensive joins, and connection pool risks. Use when reviewing list endpoints, filtered queries, joins, migrations, ORM code, production readiness, or scaling risks before launch.
In this repository25 other files it gives its agents.
- audit-asset-pipelineSkill
- audit-auth-and-access-controlSkill
- audit-corsSkill
- audit-input-validationSkill
- audit-rate-limitingSkill
- audit-resilience-and-observabilitySkill
- audit-secrets-and-configSkill
- audit-type-safetySkill
- ios-prelaunch-checklistSkill
- security-reviewSkill
- code-review-loopSkill
- error-logging-reviewSkill
- hive-parallel-review-loopSkill
- hive-review-loopSkill
- input-contract-hardeningSkill
- microskills-review-generatorSkill
- microskills-review-runnerSkill
- parallel-code-review-loopSkill
- perf-optimizationSkill
- parallel-plan-implementationSkill
- phase-commit-reviewerSkill
- product-implementation-plannerSkill
- product-plan-compilerSkill
- test-quality-reviewSkill
- verified-commit-splitSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Every frequently filtered, joined, ordered, or foreign-key column should be covered by a suitable index.
- Very specific: line 22
Search and admin views should avoid unbounded all, find_many, SELECT *, broad preloads, and full-table exports in request handlers.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Audit Database Performance
Find database access patterns that work at small scale but become slow or unstable under ordinary production traffic.
Workflow
- Identify database technology and access patterns:
- ORM, query builder, raw SQL, migrations, schemas, indexes, connection settings, and pooling.
- Inventory high-risk queries:
- List endpoints, search endpoints, exports, dashboards, joins, filtered queries, sorted queries, background jobs, and admin reports.
- Check indexes:
- Every frequently filtered, joined, ordered, or foreign-key column should be covered by a suitable index.
- Composite indexes should match common query shapes and ordering.
- Flag indexes that are missing for obvious production paths; avoid speculative index spam.
- Check result bounds:
- List endpoints should paginate or enforce limits.
- Search and admin views should avoid unbounded
all,find_many,SELECT *, broad preloads, and full-table exports in request handlers. - Background jobs should batch large data sets.
- Check connection resilience:
- Production pool size and timeout settings exist.
- App worker count, job workers, and database max connections are plausibly coordinated.
- Serverless apps avoid opening unbounded direct database connections when a pooler is required.
Useful Searches
For each issue, connect the query to a route or job and the migration/schema that lacks the supporting index or limit. When possible, include the exact filter/join/order columns.
Useful search terms include where, join, order, preload, include, limit, offset, cursor, paginate, all, findMany, SELECT, index, references, foreign_key, pool, and DATABASE_URL.
Output
Group findings by severity:
- Critical: unbounded request path likely to time out or exhaust memory.
- High: missing index on common production query or join.
- Medium: weak pagination, inefficient preload/include, pool config risk.
- Low: cleanup or documentation issue.
Each finding must include file and line, query shape, why it scales poorly, suggested migration/code fix, and the test or instrumentation that would confirm the improvement.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

