What problem does it solve? Slow database queries and hidden performance bottlenecks are hard to diagnose without deep knowledge of PostgreSQL internals. This Skill automates query plan analysis, system-wide hotpath detection, and guided optimization so you can find and fix slow queries without manually writing diagnostic SQL. ## Core Features & Use Cases - Query Plan Analysis: Runs EXPLAIN ANALYZE with BUFFERS and VERBOSE on any SQL query and interprets the execution plan with actionable recommendations. - Hotpath Detection: Scans pg_stat_statements and pg_stat_user_tables to surface the slowest queries, sequential scans, table bloat, missing foreign-key indexes, unused indexes, cache hit ratios, and connection pool status. - Interactive Optimization: Walks you through a guided session to baseline a slow query, inspect table statistics, review existing indexes, and create new indexes with before/after verification. - Use Case: Your Supabase-backed API endpoint suddenly responds slowly. Run the hotpaths analysis to identify that a frequently called query performs a sequential scan on a large table, then use the interactive mode to add the right index and confirm the improvement with EXPLAIN ANALYZE. ## Quick Start Ask the agent to analyze the performance of your slow SQL query or scan the database for performance hotpaths.