prompt

SQL Query Optimizer

Analyze query performance bottlenecks and recommend indexing, partitioning, or join reordering strategies.

Updated June 2026
The prompt
I have a {{query_description}} query on {{table_count}} tables ({{total_rows}} rows total) that runs in {{current_runtime}}. Current issues:
- {{performance_issue_1}}
- {{performance_issue_2}}

For each potential optimization (index, partitioning, materialized view, join reorder):
1. Explain the mechanism
2. Estimate runtime improvement
3. List trade-offs (storage, write performance, complexity)
4. Rank by effort-to-impact ratio
Did it work? Rate this prompt

Variables

Query description (joins, aggregations, etc.)
Number of tables
Total rows across tables
Current query runtime
First performance issue
Second performance issue

Details

Author

AI Khazna

License

Security

Type

prompt

Related assets

More curated picks in Data & Analytics.

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Data & Analytics