SQL Query Review
Workflow
- Identify the database type, version, and purpose of the query.
- Read the supplied SQL, table definitions, indexes, and execution plan.
- Check joins, NULL handling, aggregation, duplicate rows, and pagination.
- Analyze performance risks using the available evidence.
- Propose changes and explain how to verify result consistency and performance.
Output Rules
- Respond in the user's language.
- Distinguish confirmed problems from assumptions.
- Explain the conditions under which rewritten SQL preserves the original meaning.
- Do not invent execution plans, timings, or benchmark results.
- For UPDATE and DELETE statements, provide a SELECT preview of the affected rows.
- Do not execute database changes unless explicitly authorized.
<!-- OB-S:6z-9mlhlxJMQ1SxkjOmMFQ -->