SQL Query Optimizer
Optimizes slow database queries by identifying anti-patterns, generating efficient rewrites, and recommending indexing strategies.
SQL Query Optimizer equips Claude Code with senior database administrator expertise to diagnose bottlenecks, eliminate query anti-patterns, and dramatically boost database performance. It analyzes query execution patterns, refactors non-sargable predicates and inefficient joins, generates precise DDL for covering and specialized indexes (B-Tree, GIN, GiST), and provides before-and-after complexity comparisons across PostgreSQL, MySQL, SQL Server, and SQLite.
Key Features
01Recommends targeted indexing strategies including covering, B-Tree, GIN, and GiST indexes
02Suggests schema refactoring, CTE optimizations, and materialized views for complex queries
03Detects anti-patterns like non-sargable predicates, leading wildcards, and unindexed joins
04Offers engine-specific tuning tailored to PostgreSQL, MySQL, SQLite, and SQL Server
0517 GitHub stars
06Generates optimized SQL rewrites with before-and-after computational complexity analysis
Use Cases
01Refactoring slow reporting queries with complex joins, groupings, and aggregations
02Eliminating N+1 query patterns and inefficient correlated subqueries in database applications
03Designing optimal database indexing strategies for high-throughput production workloads