database-optimizer
Skill by NVlabs
Helps developers and DBAs find and fix slow queries in PostgreSQL and MySQL. Covers execution plans, index design, query rewrites, configuration tuning, partitioning and lock contention.
Install database-optimizer
Built from the published package, never by AI.
git clone --depth 1 https://github.com/NVlabs/Skill2Env /tmp/Skill2Env && mkdir -p ~/.claude/skills && cp -r /tmp/Skill2Env/SkillHub/skills/database-optimizer ~/.claude/skills/database-optimizerRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/NVlabs/Skill2Env /tmp/Skill2Env && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/Skill2Env/SkillHub/skills/database-optimizer ~/.gemini/antigravity-cli/skills/database-optimizerAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
Database Optimizer is an agent skill for improving performance in PostgreSQL and MySQL databases. It covers slow query analysis, execution plan reading, index design, query rewrites, configuration tuning, schema and partitioning changes, and lock contention. The skill also lists when to load its reference guides for query optimization, index strategies, PostgreSQL tuning, MySQL tuning and monitoring.
The skill follows a fixed workflow. It asks for a baseline with EXPLAIN ANALYZE before any change, identifies bottlenecks, designs solutions, applies changes one at a time and re-measures the results. It includes SQL examples for listing slow queries with pg_stat_statements, capturing plans with BUFFERS, creating covering indexes concurrently, and checking index usage. It is aimed at developers and database administrators who tune PostgreSQL or MySQL systems.
Written from the project's SKILL.md and checked against it.
What it can do
- Slow query analysisFinds slow queries and reads execution plans from EXPLAIN ANALYZE output.
- Index designDesigns index strategies, including covering indexes created with CONCURRENTLY in PostgreSQL.
- Query rewritesSuggests rewrites to make inefficient queries faster.
- Configuration tuningTunes database configuration parameters for performance.
- Partitioning strategiesPlans schema design and table partitioning.
- Lock contention resolutionReduces lock contention and deadlocks.
- Before and after validationRe-runs EXPLAIN ANALYZE and compares costs and timings after each change.
What you need
- A PostgreSQL or MySQL database
- The pg_stat_statements extension for the PostgreSQL slow query example
- performance_schema access for the MySQL slow query example
Try asking
- Analyze this EXPLAIN ANALYZE output and find the main bottleneck
- Suggest a covering index for my slow orders status query
- Find the top 20 slow queries in my PostgreSQL database
Good to know
- The source says to test changes in non-production first.
- Creating indexes with CONCURRENTLY is shown for PostgreSQL only.
- Some examples require the pg_stat_statements extension.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: SkillHub/skills/database-optimizer/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md6 KB -
references/index-strategies.md8 KB -
references/monitoring-analysis.md14 KB -
references/mysql-tuning.md11 KB -
references/postgresql-tuning.md10 KB
Show all 6 files
-
references/query-optimization.md6 KB
Alternatives to database-optimizer
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
database-optimizer: common questions
Which databases does Database Optimizer support?
The skill covers PostgreSQL and MySQL. It includes PostgreSQL examples using pg_stat_statements and MySQL examples using performance_schema.
Does the skill need a baseline before it optimizes anything?
Yes. The source says to capture EXPLAIN (ANALYZE, BUFFERS) output before optimizing and to measure performance before and after every change.
What should I do if an optimization makes things worse?
The source says to revert immediately if write performance degrades or replication lag increases.
How do I install database-optimizer?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is database-optimizer free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is database-optimizer safe to use?
It scores 78 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to database-optimizer?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
