Skip to main content
skill

database-optimizer · davila7 — Claude Code skill: query and schema tuning

A Claude skill that digs into database bottlenecks: execution plans, indexes, N+1, caching and partitioning. Useful when queries are slow and the reason isn't obvious.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill database/database-optimizer
Open on GitHub

What database-optimizer does

Install the skill and Claude starts acting as a database consultant. It covers execution plan analysis with EXPLAIN ANALYZE, query rewriting around subqueries and JOINs, window functions and recursive CTEs. Indexing gets its own section: B-tree, Hash, GiST, GIN, BRIN, composite and partial indexes, plus index bloat and rebuild strategies.

N+1 detection is handled too. The skill walks through ORM query analysis for Django ORM, SQLAlchemy, Entity Framework and ActiveRecord, then the fixes — eager loading, batch queries, DataLoader for GraphQL. Caching spans application-level results, Redis and Memcached, down to the database buffer pool, with TTL and event-driven invalidation. Scaling is covered by partitioning, sharding, read replicas and async writes.

PostgreSQL, MySQL, SQL Server, Oracle, MongoDB, DynamoDB and cloud databases like RDS, Aurora, Azure SQL and Cloud SQL are all in scope. For worked examples the skill points to resources/implementation-playbook.md, so that file needs to sit in the skill directory — without it you're left with the general instructions. Name your engine up front, because index advice for PostgreSQL and SQL Server pulls in different directions.

What it helps with

  • read an execution plan for a slow query
  • find and fix N+1 queries in ORM code
  • pick indexes for frequently filtered columns
  • plan partitioning for a large table
  • add a cache layer between app and database

Example prompts for the agent

  • Look at the execution plan for this query and tell me what to rewrite
  • This Django ORM code has an N+1 problem — find it and fix it
  • Which indexes should I add to the orders table for date and status filters?

How to install database-optimizer

1claude-code-templates

npx claude-code-templates@latest --skill database/database-optimizer

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill database-optimizer -a claude-code

3Manually: put the files in place

~/.claude/skills/database-optimizer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/database-optimizer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about database-optimizer

How do I install database-optimizer in Claude?

Use the templates CLI: npx claude-code-templates@latest --skill database/database-optimizer. Alternatively run npx skills add davila7/claude-code-templates --skill database-optimizer -a claude-code. The skill file ends up at ~/.claude/skills/database-optimizer/SKILL.md.

What does database-optimizer do?

It helps you work through database performance: execution plan analysis, query rewriting, index selection, N+1 elimination, caching, partitioning and sharding.

Which databases does it cover?

PostgreSQL, MySQL, SQL Server, Oracle, MongoDB, DynamoDB, plus cloud options such as RDS, Aurora, Azure SQL and Cloud SQL. Mention your engine in the prompt.

Similar skills

All skills for Data and databases →

database-optimizer by other authors comes first.

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor