postgres-impl-query-performance-toolkit
Installation
SKILL.md
postgres-impl-query-performance-toolkit
Quick Reference :
This skill is the diagnostic toolkit for "why is this slow". It merges three workflows: read a plan (EXPLAIN), find the worst queries server-wide (pg_stat_statements), and unstick a blocked session (pg_stat_activity + pg_locks).
The single most common mistake: trusting EXPLAIN cost numbers as real time. Cost is
in arbitrary planner units, not milliseconds. Only EXPLAIN ANALYZE reports real time,
and it does so by EXECUTING the query. The second most common mistake: tuning the plan
when the planner's row estimate is wrong because statistics are stale. Fix the estimate
first (ANALYZE), then re-read the plan.