Database Index Advisor
Analyze slow queries, recommend indexes, and generate migration scripts
Example Prompt
Find our slowest database queries, recommend indexes, and generate the migration scripts
About
Examines the database's slow query log and execution plans to identify queries that would benefit from indexing. Recommends optimal index strategies based on query patterns and table statistics, then generates ready-to-use migration scripts for the proposed indexes.
Workflow Steps
Query the PostgreSQL slow query log and pg_stat_statements for underperforming queries
📊 Run SQL QueryRun EXPLAIN ANALYZE on the slowest queries to examine execution plans
📊 Run SQL QueryAnalyze execution plans and recommend optimal indexes based on query patterns
🧠 Structured ReasoningGenerate SQL migration scripts for the recommended indexes
✏️ Write FilePost the index recommendations and expected performance improvements to Slack
📨 Send MessageTools Used
Write File
Write or overwrite a file at a specified path with the given content
Run SQL Query
Execute a read-only SQL query against a PostgreSQL database and return results
Structured Reasoning
Break down a complex problem into sequential reasoning steps with explicit chain-of-thought
Send Message
Send a message to a Slack channel or direct message conversation
Required MCP Servers
Filesystem
Read, search, and manage files on the local filesystem
PostgreSQL
Query, inspect, and manage PostgreSQL databases with full SQL support
Sequential Thinking
Dynamic problem-solving through structured thought sequences with branching and revision
Slack
Send messages, read channels, and manage Slack workspace interactions