What problem does it solve? Slow queries, connection exhaustion, and unsafe schemas are the most common Postgres production issues, and they are hard to diagnose without deep database expertise. This Skill provides a curated, priority-ranked rulebook so you can write and review SQL correctly the first time. ## Core Features & Use Cases - Priority-ranked rule categories: Work top-down from critical issues (missing indexes, connection pooling, RLS) to lower-impact ones (partitioning, JSONB, full-text search), each with incorrect vs. correct SQL examples. - Query and schema review: Diagnose slow queries with EXPLAIN ANALYZE guidance, choose the right index type (B-tree, GIN, GiST, BRIN), and design schemas with proper data types, primary keys, and foreign key indexes. - Concurrency and security patterns: Prevent deadlocks with consistent lock ordering, build worker queues with SKIP LOCKED, and enforce tenant isolation with performant Row-Level Security policies. - Use Case: A developer reviewing a migration that adds a new table can check it against the schema design rules, verify foreign key columns are indexed, and confirm RLS policies use the performant (select ...) pattern before merging. ## Quick Start Review my SQL migration and slow query against the Postgres best practices rules and suggest fixes with the rule names cited.