SQL Performance

Make a slow SQL query fast, or prove it cannot be: start from the statement with the most total time in pg_stat_statements or MySQL's performance_schema, not the one someone complained about, read EXPLAIN (ANALYZE, BUFFERS) from the deepest node out to the first place estimated and actual rows diverge tenfold, and fix what that divergence names — stale statistics, a correlated predicate, a generic plan. Covers index choice and column order, ORM N+1 in the query log, and pool exhaustion that only looks like a slow query. Use this skill whenever someone says "this endpoint takes 4 seconds", "why is postgres not using my index", "explain analyze output attached", or asks whether a column needs an index. Not for a wrong answer rather than a slow one, which is debugging; not for shipping a schema change, which is db-migration; not for sizing for an expected peak, which is capacity-planning; not for time outside the query itself, which is profiling.

greenblacked Updated
The twenty-nine plugins: coding, family, gamedev, operations, delivery, security, manager, personal, career, design, llm, data, techdocs, assurance, client-apps

File contents

greenblacked/AI commit 99498d49b3

Frequently asked questions

npx get-skill add greenblacked/sql-performance