query-optimization

Installation
SKILL.md

Query Optimization Skill

Phase 1 — Discovery

Ask only what context doesn't reveal:

  • Database engine and version? Planner behavior, available hints, and index types differ significantly. Postgres 14+ has improved parallel query and CTE materialization defaults vs. older versions.
  • Do you have EXPLAIN ANALYZE output? Without it, optimization is guesswork. Ask them to run it and share — not just EXPLAIN (estimates only), but EXPLAIN (ANALYZE, BUFFERS) which shows actual row counts and I/O.
  • Table row counts for involved tables? The planner's choices make sense or don't in context of data volume.
  • Is this a one-time slow query or a recurring endpoint? One-time queries tolerate different tradeoffs (parallel workers, temp indexes) vs. a hot path that runs thousands of times per minute.
  • Are statistics up to date? Ask if ANALYZE has been run recently on large tables. Stale statistics cause the planner to make systematically wrong choices.

Phase 2 — Plan Analysis

Reading EXPLAIN ANALYZE — what to look for first

Rows estimate vs. actual rows — the most important signal:

Related skills

More from blunotech-dev/agents

Installs
1
GitHub Stars
2
First Seen
Apr 22, 2026