Postgres deep

From rnavarych/alpha-engineer · View interactive version

Postgres deep is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. PostgreSQL deep-dive: EXPLAIN ANALYZE interpretation, index types (B-tree, GIN, GiST, BRIN), partial/covering/composite indexes, pg_stat_statements slow query analysis, Row Level Security, window functions, CTEs, advisory locks, LISTEN/NOTIFY, connection pooling with PgBouncer. Use when optimizing s

How to use this skill

Skill file

PostgreSQL Deep Dive

When to Use This Skill

Core Principles

  1. EXPLAIN ANALYZE before optimizing — never guess; measure first; the plan shows the actual cost
  2. Index the access pattern, not the column — a composite index (user_id, created_at DESC) beats two separate indexes for paginated user queries
  3. Partial indexes reduce size and maintenance cost — WHERE status = 'pending' on a 10M row table with 1000 pending rows = tiny, fast index
  4. RLS is enforced at the DB layer — even if application code has a bug, unauthorized rows are invisible
  5. pg_stat_statements is your slow query log — enable it; it shows cumulative query costs across all calls

References available

Scripts available

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.