database-optimizer
Skill by Jeffallan
Optimizes database queries and performance on PostgreSQL and MySQL. Aimed at engineers investigating slow queries, reading execution plans, or tuning indexes and configuration.
Install database-optimizer
Built from the published package, never by AI.
git clone --depth 1 https://github.com/Jeffallan/claude-skills /tmp/claude-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-skills/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/Jeffallan/claude-skills /tmp/claude-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-skills/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 that helps an AI assistant analyze and improve query and database performance on PostgreSQL and MySQL. It is meant for slow query investigation, execution plan analysis, and general database performance work.
The skill follows a set workflow. It captures baseline metrics and runs EXPLAIN ANALYZE before any change, finds bottlenecks such as missing indexes or config issues, and then applies changes one at a time. It re-checks the results and documents before and after metrics. The skill includes SQL examples for finding top slow queries, capturing plans with buffer statistics, creating covering indexes, and checking index usage. Reference guides cover query optimization, index strategies, PostgreSQL and MySQL tuning, and monitoring.
Written from the project's SKILL.md and checked against it.
What it can do
- Slow query analysisFinds the slowest queries using pg_stat_statements on PostgreSQL or performance_schema on MySQL.
- Execution plan reviewCaptures EXPLAIN ANALYZE output with buffer stats and explains common plan patterns.
- Index designSuggests indexes, including covering indexes, and creates them with CONCURRENTLY on PostgreSQL.
- Query rewritesRecommends query changes based on execution plan evidence.
- Configuration tuningCovers tuning parameters for PostgreSQL and MySQL, such as shared_buffers and work_mem.
- Partitioning and locksCovers partitioning strategies and lock contention resolution.
- Validation and reportingCompares before and after metrics and lists the output format for an optimization report.
What you need
- PostgreSQL or MySQL database
- pg_stat_statements extension for the PostgreSQL slow query example
Try asking
- Find the top 20 slowest queries in my PostgreSQL database and suggest fixes.
- Run EXPLAIN ANALYZE on this query and explain the bottleneck.
- Design a covering index for my orders table filtered by status and created_at.
Good to know
- The top slow query example requires the pg_stat_statements extension.
- The source recommends testing all changes in non-production first.
- Examples cover PostgreSQL and MySQL only.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/database-optimizer/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
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 the database optimizer skill support?
The source says it covers PostgreSQL and MySQL systems. Its examples and reference guides include both.
Does it change my database automatically?
The source describes applying changes incrementally with monitoring and provides SQL and config changes to implement. It also says to test in non-production first and roll back if write performance or replication lag worsens.
What is the first step the skill takes?
It captures baseline metrics and runs EXPLAIN ANALYZE before making any changes. The source treats a measured baseline as a requirement.
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 MIT licence. The service it connects to may have its own pricing.
Is database-optimizer safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality A. 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.
