prompt
SQL Query Explainer & Optimizer
Break down complex SQL logic, explain query performance issues, and suggest optimization strategies.
Updated June 2026
The prompt
Query language: {{sql_dialect}}. Query: {{query_text}} Context: {{query_purpose}}. Execution time: {{exec_time}}. Expected time: {{expected_time}}. Dataset size: {{data_size}}. Provide: 1. Line-by-line explanation of joins, aggregations, filters 2. Query execution plan analysis (if available: {{execution_plan}}) 3. Performance bottlenecks: which step is slowest? 4. Index recommendations 5. Rewrite options (window functions vs. subqueries, etc.) 6. Expected improvement in {{exec_time}} with each optimization
Did it work? Rate this prompt
Variables
SQL flavor (MySQL, PostgreSQL, Snowflake, BigQuery, etc.)The full SQL queryWhat this query is used forCurrent execution timeExpected/target execution timeSize of tables being queriedQuery plan (if available)Details
Author
AI Khazna
License
—
Security
—
Type
prompt
Related assets
More curated picks in Data & Analytics.
prompt
Turns a set of findings into a clear narrative with a headline, supporting points, and a call to action.
Data Storytelling Builder
Turns a set of findings into a clear narrative with a headline, supporting points, and a call to action.0+
prompt
Get a structured, step-by-step plan to clean a messy dataset before analysis.
Data Cleaning Plan Generator
Get a structured, step-by-step plan to clean a messy dataset before analysis.0+
prompt
Plans a pivot table to answer a specific question from your data.
Pivot Table Planner
Plans a pivot table to answer a specific question from your data.0+
prompt
Produces a structured checklist to audit a dataset across completeness, accuracy, consistency, and timeliness.
Data Quality Audit Checklist
Produces a structured checklist to audit a dataset across completeness, accuracy, consistency, and timeliness.0+
prompt
Describe what you want in words and get the exact Excel formula, plus a short explanation of how it works.
Excel Formula Builder
Describe what you want in words and get the exact Excel formula, plus a short explanation of how it works.0+
prompt
Define the right KPIs, chart types, and layout for a dashboard that serves a specific goal and audience.
KPI Dashboard Planner
Define the right KPIs, chart types, and layout for a dashboard that serves a specific goal and audience.0+
Audit before you install
Run any source through our checks - AI visibility, security, performance, and stack detection.
Automated Web Security Scan
security
PageSpeed Analyzer
performance
AI Content Quality Test
arabic content
AI Agent / MCP Server Tester
ai testing
Site Stack Detector
migration
AI SEO / AEO / GEO Audit
ai visibility
llms.txt Generator
ai visibility
Readability Score
arabic content
Schema / JSON-LD Builder
ai visibility
AI Cost Calculator
ai testing
Headline Analyzer
arabic content