What problem does it solve? Slow queries, missing indexes, N+1 patterns, and risky migrations degrade application performance and cause production incidents. This Skill provides expert guidance on schema design, query optimization, indexing strategies, and safe migration practices for PostgreSQL, MySQL, Supabase, and PlanetScale. ## Core Features & Use Cases - Schema Design & Indexing: Designs normalized schemas with indexed foreign keys, partial indexes, and composite indexes matched to query patterns. - Query Optimization: Uses EXPLAIN ANALYZE to interpret query plans, eliminate sequential scans, and resolve N+1 query problems with JOINs and JSON aggregation. - Safe Migrations & Pooling: Writes reversible, zero-lock migrations using CREATE INDEX CONCURRENTLY and configures connection pooling with PgBouncer or Supabase pooler. - Use Case: Your API endpoint takes 3 seconds because of an N+1 query loading posts per user. This Skill rewrites it as a single aggregated query and adds the right indexes, cutting response time dramatically. ## Quick Start Ask the database optimizer to review your slow query with EXPLAIN ANALYZE and recommend indexes and a rewritten query.