What problem does it solve? Slow queries, missing indexes, bloated tables, and fragile replication setups degrade PostgreSQL databases in production. This Skill provides senior-DBA-level guidance for diagnosing performance issues, designing indexes, configuring replication, and maintaining database health. ## Core Features & Use Cases - Query Optimization: Analyze slow queries with EXPLAIN (ANALYZE, BUFFERS) and pg_stat_statements, then rewrite queries and design B-tree, GIN, GiST, or BRIN indexes. - Replication & High Availability: Set up streaming or logical replication with failover and lag monitoring. - JSONB & Extensions: Implement JSONB storage with GIN indexing and configure extensions like PostGIS, pgvector, pg_trgm, and pg_stat_statements. - Use Case: A dashboard query takes 30 seconds. Use this Skill to run EXPLAIN ANALYZE, identify a sequential scan, add the right index, tune autovacuum, and verify the improvement with before/after metrics. ## Quick Start Ask the agent to analyze a slow PostgreSQL query with EXPLAIN ANALYZE and recommend indexes and configuration changes.