Query Performance Fixer
An automated workflow to identify, analyze, and optimize slow-running database queries through iterative benchmarking and targeted improvements.
This loop is republished with attribution. Full credit and the original content belong to the source linked above.
AI Skill Market Insights
Real data. Real impact.
Emerging
Developers
Kickoff Prompt
Copy this prompt and run it with your agent to start the loop.
Start the "Query Performance Fixer" loop.
Goal: Reduce query execution time to meet performance thresholds
Max iterations: 10
Between iterations run: query benchmark
Exit when: Query execution time under 100ms
Please provide the SQL query that needs optimization and specify your performance threshold. I will analyze it, run benchmarks, and iteratively apply optimizations until we meet the target performance or reach the maximum iterations.
Self-pace this loop. After each iteration, run `query benchmark` and evaluate the output, and only continue if the exit condition is not met (Query execution time under 100ms). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.