What problem does it solve? Slow database queries, missing indexes, and N+1 query patterns degrade application performance and increase infrastructure costs, and diagnosing them requires deep knowledge of query plans and index design. ## Core Features & Use Cases - EXPLAIN Plan Analysis: Interpret PostgreSQL EXPLAIN ANALYZE output including scan types, join methods, costs, and actual execution times. - Index Strategy Design: Create B-Tree, GIN, partial, covering, composite, and expression indexes matched to query patterns. - Query Rewriting Patterns: Eliminate N+1 queries, replace OFFSET pagination with cursor-based pagination, optimize aggregations, and batch INSERT/UPDATE operations. - Use Case: A dashboard endpoint takes 8 seconds because it runs a correlated subquery per row; rewrite it as a JOIN with aggregation, add a composite index on (user_id, status), and verify the improvement with EXPLAIN ANALYZE. ## Quick Start Analyze this slow PostgreSQL query with EXPLAIN ANALYZE and recommend indexes and rewrites to make it faster.