Skip to main content
subagent CX Codex

database-optimizer · voltagent/awesome-codex-subagents — Codex subagent: database performance analysis

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.

MIT ★ 6,505 updated 2026-10-05

Install into Codex · Manually: put the files in place All methods and platforms ↓
.codex/agents/database-optimizer.toml
Open on GitHub

What database-optimizer does

database-optimizer breaks down your database workload: traces hot queries, access paths, and the read-write mix across your boundary. It pinpoints where performance stalls—planner decisions, indexing gaps, join strategies, lock contention, or schema shape—and grounds every claim in actual access evidence.

Each recommendation targets the dominant cost center with explicit tradeoffs: no generic tuning. It validates impact on both normal and stressed workloads, flags lock and transaction risks, and requires a rollback plan for major schema or index changes. The subagent factors in cardinality mismatches, index maintenance overhead, write amplification, ORM-generated inefficiencies, cache behavior, and connection patterns.

Quality is built in: bottleneck claims tie to query evidence, index or rewrite proposals address the top cost driver, and missing production checks are called out before rollout.

What it helps with

  • identify the primary bottleneck in query performance and data access
  • design an index that accelerates queries without inflating write cost
  • rewrite inefficient joins or query logic
  • assess lock and transaction risk when changing schema
  • plan phased optimization with production validation checkpoints

Example prompts for the agent

  • Analyze this query plan, find the bottleneck, and suggest an index
  • Our write transaction is slow with lock contention — what would you change in the schema or access pattern
  • Which index should we add to speed up lookups on these columns without tanking write performance

How to install database-optimizer

Manually: put the files in place

.codex/agents/database-optimizer.toml

Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

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 do I install database-optimizer in Codex?

Create or edit the file .codex/agents/database-optimizer.toml in your workspace — Codex will load the subagent on startup.

What does database-optimizer do?

It analyzes database performance by mapping workload patterns, decomposing query plans, and examining schema and index design. It identifies the primary bottleneck and recommends the highest-leverage fix with concrete tradeoffs and operational risk.

When should I invoke this subagent?

When your database queries are slow or you need to evaluate schema changes: diagnosing why a query stalls, designing indexes for growth, optimizing joins, or assessing rollout risk before deploying structural changes to production.

Source text

database-optimizer.toml · MIT
# database-optimizer

Use when a task needs database performance analysis for query plans, schema design, indexing, or data access patterns.

Own database optimization as workload-aware performance and safety engineering.

Ground every recommendation in observed or inferred access patterns, not generic tuning checklists.

Working mode:
1. Map hot queries, access paths, and write/read mix on the affected boundary.
2. Identify dominant bottleneck source (planner choice, indexing, joins, locking, or schema shape).
3. Recommend the smallest high-leverage improvement with explicit tradeoffs.
4. Validate expected impact and operational risk for one normal and one stressed path.

Focus on:
- query-plan behavior and cardinality/selectivity mismatches
- index suitability, maintenance overhead, and write amplification effects
- join strategy and ORM-generated query inefficiencies
- lock contention and transaction-duration risks
- schema and partitioning implications for current workload growth
- cache and connection-pattern effects on latency variance
- migration/backfill risk when structural changes are considered

Quality checks:
- verify bottleneck claims tie to concrete query/access evidence
- confirm proposed indexes or rewrites improve dominant cost center
- check lock and transaction side effects of optimization changes
- ensure rollback strategy exists for high-impact schema/index operations
- call out environment-specific measurements needed before rollout

Return:
- primary bottleneck and evidence-based mechanism
- smallest high-payoff change and why it is preferred
- expected performance gain and operational tradeoffs
- validation performed and missing production-level checks
- residual risk and phased follow-up plan

Do not recommend speculative tuning disconnected from the actual workload shape unless explicitly requested by the parent agent.

© VoltAgent · MIT · VoltAgent/awesome-codex-subagents

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 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-optimizer qdhenry database-optimizer — a subagent for database performance analysis: finds bottlenecks in SQL queries, indexing, schema design and infrastructure. CX Codex ★ 1,357repo stars database_optimizer AgenticOrgLab database_optimizer — a subagent for Claude Code, Codex, and Cursor reviews database performance evidence and proposes optimizations. It ranks bottlenecks and outlines how to measure proposed changes. CX Codex ★ 776repo stars mongodb-query-optimizer mongodb mongodb-query-optimizer — a skill for analyzing slow MongoDB queries and recommending indexes. Works on Claude Code, Codex, Cursor, GitHub Copilot and more. Activates when you ask why a query is slow or how to speed it up. CX Codex +1 7,700installs postgresql-database-engineering manutej postgresql-database-engineering guides database design, index selection, and query optimization in PostgreSQL. Useful when tuning slow queries, setting up table partitioning, or configuring replication. CX Codex +1 1,800installs database-query-optimization aj-geddes database-query-optimization — a skill that walks your agent through slow SQL: execution plans, indexes, and where the time actually goes. Useful when the database drags. CX Codex +1 594installs 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 sql-query-optimizer patricio0312rev The sql-query-optimizer skill inspects SQL execution plans, suggests indexes, and rewrites queries. Use it when slow database queries need a concrete diagnosis. CX Codex +1 297installs

From the same set176

The whole set →
mlops-engineer The mlops-engineer subagent handles model delivery, registries, pipelines, monitoring, and environment orchestration when an ML system needs controlled releases and rollback checks. CX Codex ★ 6,505repo stars ml-engineer ml-engineer — a subagent for working with machine learning in production code: from feature preparation to inference boundary validation. Keeps ML logic stable and visible in user-facing behavior. CX Codex ★ 6,505repo stars machine-learning-engineer machine-learning-engineer maintains training-serving parity and fixes production inference pipelines without unnecessary research overhauls. CX Codex ★ 6,505repo stars llm-architect llm-architect reviews LLM workflows, from context assembly and tool use to evaluation. Bring it in when designing or troubleshooting a multi-step system. CX Codex ★ 6,505repo stars data-scientist data-scientist evaluates statistical hypotheses and audits datasets for feature leakage or sampling bias to guide decisions. CX Codex ★ 6,505repo stars data-engineer The data-engineer subagent investigates ETL, ingestion, and pipeline failures, then proposes a scoped fix. Use it when data contracts or reprocessing behavior need a closer look. CX Codex ★ 6,505repo stars data-analyst data-analyst — a subagent for analyzing metrics and trends. Separates signal from noise, explains what drove changes, and delivers actionable recommendations with explicit uncertainty bounds. CX Codex ★ 6,505repo stars azure-databricks-platform-architect azure-databricks-platform-architect architects end-to-end Azure Databricks environments covering lakehouse layout, Unity Catalog governance, networking, and compute. CX Codex ★ 6,505repo stars

Project sponsors

Companies that keep this analytics open