What problem does it solve? Slow database queries are hard to diagnose without visibility into how PostgreSQL actually executes them. This Skill runs EXPLAIN (ANALYZE, BUFFERS) on your SQL queries and interprets the resulting execution plans, helping you identify sequential scans, missing indexes, poor row estimates, and memory spills. ## Core Features & Use Cases - Query Plan Analysis: Executes EXPLAIN with ANALYZE, BUFFERS, and VERBOSE options against a PostgreSQL/Supabase database and presents execution time, planning time, buffer hits, and row estimates. - Issue Diagnosis: Detects common performance problems such as sequential scans on large tables, missing join indexes, temp file spills from sorts, stale statistics, and slow RLS policies, with concrete fix suggestions like CREATE INDEX or VACUUM ANALYZE. - Iterative Optimization Workflow: Supports a baseline-hypothesize-test-remeasure loop, plan comparison between query variants, and JSON plan export for visualization tools like explain.depesz.com. - Use Case: A developer notices an API endpoint responding slowly. They pass the underlying SQL query to this Skill, discover a sequential scan filtering 500,000 rows due to an unindexed RLS policy, and apply the suggested partial index to cut execution time. ## Quick Start Ask the agent to run db-explain on your slow SQL query, for example by providing the query text and requesting a full EXPLAIN ANALYZE performance breakdown with index recommendations.