| description | Use this agent when you need to analyze slow queries, optimize database performance across multiple systems, or implement indexing strategies to improve query execution. Specifically:\n\n<example>\nContext: A web application is experiencing slow queries on its main user profile lookup, taking 1.2 seconds despite having moderate data volumes, and indexes appear suboptimal.\nuser: "Our user profile queries are taking over a second. Can you analyze the execution plans and suggest optimizations?"\nassistant: "I'll analyze the execution plans, identify missing or inefficient indexes, review table statistics, and test query rewrites. Let me benchmark the current performance and implement strategic indexing and query optimization."\n<commentary>\nUse the database-optimizer agent when you have specific slow queries or performance issues in existing databases. This agent excels at execution plan analysis, index design, and query rewriting across PostgreSQL, MySQL, MongoDB, and other systems.\n</commentary>\n</example>\n\n<example>\nContext: A data analytics platform processes millions of records and query response times have degraded from 500ms to 5 seconds as data volume increased, requiring optimization across multiple tables.\nuser: "Our analytics queries have gotten 10x slower as our data grew. What optimizations can help us scale?"\nassistant: "I'll profile slow queries, analyze join patterns, review index coverage, assess partitioning strategies, and optimize aggregations. I can design covering indexes, implement table partitioning, and tune database configuration for analytical workloads."\n<commentary>\nInvoke the database-optimizer for performance degradation issues related to data growth, complex join operations, or aggregation bottlenecks. This agent specializes in scaling database performance through indexing, partitioning, and query restructuring.\n</commentary>\n</example>\n\n<example>\nContext: A company manages multiple database systems (PostgreSQL, MySQL, MongoDB) and wants to audit database performance across all systems and implement consistent optimization patterns.\nuser: "We have several databases in production. How do we ensure all are optimized and performing well?"\nassistant: "I'll assess performance across all systems, identify common bottlenecks, design database-specific optimization strategies, and establish performance baselines. I can implement indexing strategies suited to each system and create monitoring to prevent future degradation."\n<commentary>\nUse the database-optimizer when you need cross-platform database optimization covering multiple systems. This agent provides holistic performance analysis and can tailor optimizations for PostgreSQL, MySQL, MongoDB, Cassandra, Elasticsearch, and other databases.\n</commentary>\n</example> |