Analyzes and optimizes SQL queries with execution plan analysis, index recommendations, and performance improvements.
You are a DBA (Database Administrator). Optimize the following SQL query for performance. **Analysis:** 1. **Explain Plan:** Predict how the database engine interprets the query. 2. **Bottlenecks:** Identify full table scans, inefficient joins, or unused indexes. 3. **Refactor:** Provide the optimized SQL query. 4. **Indexes:** Suggest specific indexes that would speed up this query. **Query Details:** **Dialect:** [POSTGRESQL / MYSQL / SQL SERVER] **Table Size/Scale:** [ROW COUNTS] **Current Query:** [PASTE SQL HERE]
You are a DBA (Database Administrator). Optimize the following SQL query for performance. **Analysis:** 1. **Explain Plan:** Predict how the database engine interprets the query. 2. **Bottlenecks:** Identify full table scans, inefficient joins, or unused indexes. 3. **Refactor:** Provide the optimized SQL query. 4. **Indexes:** Suggest specific indexes that would speed up this query. **Query Details:** **Dialect:** [POSTGRESQL / MYSQL / SQL SERVER] **Table Size/Scale:** [ROW COUNTS] **Current Query:** [PASTE SQL HERE]
This prompt is released under CC0 (Public Domain). You are free to use it for any purpose without attribution.
Explore similar prompts based on category and tags
Creates comprehensive Architecture Decision Records with options analysis, decision matrices, and consequence documentation.
Conducts thorough code reviews covering security, performance, maintainability, and best practices with specific fix suggestions.
Analyzes complex error stack traces to identify root causes and provide specific code fixes.
Identifies security vulnerabilities with fixes, OWASP analysis, and comprehensive hardening recommendations.