Skip to main content
subagent CX Codex

database-optimizer · qdhenry — Claude Code subagent for database tuning

database-optimizer — a subagent for database performance analysis: finds bottlenecks in SQL queries, indexing, schema design and infrastructure.

no license ★ 1,357 updated 2026-03-01

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/database-optimizer.md
Open on GitHub

What database-optimizer does

The subagent dissects slow queries with EXPLAIN ANALYZE, suggests indexes tailored to specific query patterns, and refines schemas through normalization or strategic denormalization. It spots N+1 queries, locking conflicts, and points out where to add caching layers like Redis.

Inside: file read/write, grep, bash, web search, and MCP servers context7 (DBMS docs and optimization patterns) and sequential-thinking (step-by-step migration planning). Supports PostgreSQL, MySQL, MongoDB.

Before each recommendation it asks for the DBMS and table schemas. Never modifies data directly: outputs ready-to-run scripts for manual execution.

What it helps with

  • rewrite a slow SQL query after profiling it
  • design indexes for frequent filter patterns
  • detect N+1 queries in ORM code
  • plan zero-downtime schema migrations
  • add caching for expensive analytical queries

Example prompts for the agent

  • Profile the query in queries/reports.sql with EXPLAIN ANALYZE and show where it slows down
  • Suggest indexes for the orders table to speed up filtering by status and date
  • Find all places in the codebase where the ORM makes N+1 queries to users

How to install database-optimizer

Manually: put the files in place

.claude/agents/database-optimizer.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about database-optimizer

How to install database-optimizer in Claude Code?

Place the subagent file at .claude/agents/database-optimizer.md.

What does database-optimizer do?

Analyzes database performance: profiles query execution plans, recommends indexes, cleans up schemas, and plans migrations. Does not modify data itself — outputs scripts for manual execution.

Which databases does database-optimizer support?

PostgreSQL, MySQL and MongoDB. Asks which DBMS you use before starting, to provide accurate syntax.

Similar subagents

All subagents for Data and databases →

database-optimizer by other authors comes first.

database-optimizer VoltAgent Community database-optimizer is a Claude Code subagent that analyzes slow queries and improves database performance. It handles query tuning and indexing tasks. CX Codex 3,320installs database-optimizer VoltAgent database-optimizer — a subagent that analyzes database performance. Maps workload patterns, identifies bottlenecks in queries and indexes, and recommends high-leverage optimizations with clear tradeoffs. CX Codex ★ 6,505repo stars database-optimizer rohitg00 database-optimizer — a subagent that diagnoses slow queries, designs indexes, implements partitioning schemes, and plans capacity for PostgreSQL, MySQL, and distributed databases. CX Codex ★ 2,858repo stars database-performance-optimizer Alysson Franklin database-performance-optimizer diagnoses query bottlenecks, optimizes composite indexes, and configures tenant-aware connection pooling for multi-tenant SaaS platforms. CX Codex ★ 1,013repo stars database-performance-debugging aj-geddes database-performance-debugging — a skill that walks your agent through finding slow SQL queries and reading their execution plans. Useful when the app drags or the database burns CPU. CX Codex +1 500installs database-cloud-optimization-database-optimizer Seth Hobson database-cloud-optimization-database-optimizer — a subagent that digs into slow queries, indexes and schema design. Useful when the database drags or needs to scale. CX Codex ★ 42,780repo stars database magurelabs Links assistants directly to external databases. Queries and updates tables or collections across SQL and NoSQL engines. CX Codex +1 ★ 10repo stars database-administrator VoltAgent Community database-administrator is a Claude Code subagent for database operations and performance work. It joins tasks involving high availability, backup planning, and disaster recovery. CX Codex 452installs

From the same set112

The whole set →
golang-pro golang-pro — a Go-focused subagent for architecture, implementation, refactoring, concurrency, APIs, testing, and performance work in Claude Code. CX Codex ★ 1,357repo stars architect-reviewer architect-reviewer — a Claude subagent that reads a change for architectural fit: patterns, SOLID, dependency direction. Useful after structural edits or a new service. CX Codex ★ 1,357repo stars orchestration-readme orchestration-readme breaks large features into structured task files, tracks active stages, and aligns code changes with Git commits inside Claude Code. CX Codex +1 ★ 1,357repo stars data-engineer The data-engineer subagent designs data pipelines, warehouses, and streaming systems. Use it for ETL/ELT work, Spark jobs, Airflow flows, or Kafka architectures. CX Codex ★ 1,357repo stars ui-designer ui-designer — a Claude Code subagent for building interface mockups, design systems, and accessible layouts using magic and context7 MCP servers. CX Codex ★ 1,357repo stars cloudflare-worker Generate a Cloudflare Worker from a task description, with Wrangler configuration and sample requests. Useful for building an API, WebSocket service, or authentication middleware. CX Codex +1 ★ 1,357repo stars legacy-modernizer legacy-modernizer is a Claude Code subagent for planning and carrying out gradual changes to legacy systems. It engages on framework upgrades, codebase refactors, and monolith decomposition. CX Codex ★ 1,357repo stars todo-worktree todo-worktree takes tasks from a todo list and implements them inside isolated git worktrees with strict phased approvals. CX Codex +1 ★ 1,357repo stars

Project sponsors

Companies that keep this analytics open