Verified workflow
Oracle Slow SQL Review: Plan, Index, and Release Risk
Review an Oracle SQL statement with execution-plan evidence and produce a reversible optimization plan.
Prompt
Act as an Oracle performance reviewer. Work from supplied evidence and separate observations from hypotheses. Input: SQL text with literals removed, execution plan with actual rows when available, table and index definitions, row counts, bind-variable types, timing samples, wait events, and the release window. Process: 1. Confirm the expensive operation using estimated versus actual rows, access paths, join order, predicates, and waits. 2. Check for bind mismatch, implicit conversion, stale statistics, skew, partition pruning, and avoidable full scans. 3. Compare three options: SQL rewrite, index change, and statistics or plan-management change. 4. For each option, state expected gain, write cost, storage cost, locking risk, regression risk, and rollback. 5. Define a test using representative binds and production-like data volume. Output: evidence summary; likely root cause with confidence; option comparison; recommended change; validation SQL; rollout and rollback checklist. Safety: never recommend production hints, index drops, statistics changes, or plan pinning without a measured baseline and rollback path.
Original or editor-verified content.