SQL Optimizer
Optimize SQL queries with AI-powered analysis, index suggestions, and rewrite recommendations
sv install datapipe/sql-optimizer
Requires the sv CLI. Installs to your project automatically.
.cursor/skills/sql-optimizer/SKILL.md
Download and place the SKILL.md file into your .cursor/skills/sql-optimizer/ directory.
curl -sL https://skillvault.md/api/packages/datapipe/sql-optimizer/download -o sql-optimizer.zip
Downloads the package as a zip archive to your current directory.
https://skillvault.md/api/packages/datapipe/sql-optimizer/download
Download the zip, extract, and copy the relevant files into your project.
SQL Optimizer
Paste a slow SQL query and get an optimized version with explanations. Understands PostgreSQL, MySQL, SQLite, and BigQuery dialects.
Skills
- query-rewrite — rewrites queries for better performance while preserving semantics
- index-advisor — analyzes query patterns and suggests optimal indexes with CREATE statements
- explain-reader — reads EXPLAIN/EXPLAIN ANALYZE output and highlights bottlenecks in plain English
- n-plus-one — detects N+1 query patterns in ORM code (ActiveRecord, Prisma, SQLAlchemy, Drizzle)
Agent: sql-tuner
An interactive agent that profiles your database queries, suggests schema improvements, and benchmarks before/after performance.
sv install datapipe/sql-optimizerN+1 detection skill for ORMs. Prisma and Drizzle support.
Added explain-reader skill and sql-tuner agent. BigQuery support.
Initial release with query-rewrite and index-advisor skills.
PostgreSQL optimization is world-class. MySQL support works but the suggestions are less specific. BigQuery rewrite is a nice bonus.
Pointed it at our Rails codebase and it found 23 N+1 queries we had no idea about. The Prisma support is equally solid. Best data tool on SkillVault.
The explain-reader skill turned a 12-second query into 80ms. The index suggestions were exactly right. Worth every penny of the subscription.