#86coding

Optimize a Slow SQL Query

Diagnoses query performance and proposes measured, safe improvements.

0 views 0by @yazeed
Base prompt
Analyze this slow [database engine] query, schema, indexes, row counts, and execution plan: [materials]. Explain the actual bottleneck using the plan, then propose the smallest useful query or index changes. Preserve result semantics and parameter behavior. Estimate tradeoffs for writes and storage. Show before-and-after validation with representative data and execution statistics; if no plan is available, list what to collect before claiming a speedup.

Follow-up steps

  1. 1

    Refine and verify

    Tests the output against the original goal and improves its practical usefulness.

    step 1
    Compare result sets and execution statistics before and after the change under representative parameters, including the slowest case.

Comments0

Sign in

No comments yet.