D8LooPFocus modeCODE WORKSPACE
Return query triage labels for expensive, wide, or full-scan query runs.
Start by naming the output grain, then build CTEs that can be inspected one at a time.
Sample input
| query_id | query_label | gb_scanned | partitions_scanned |
|---|---|---|---|
| 2 | orders_export | 240 | 8 |
| 6 | adhoc_select_star | 180 | 8 |
| 4 | event_funnel | 85 | 6 |
Expected output
| query_id | triage_status |
|---|---|
| 2 | full_scan_review |
| 6 | full_scan_review |
| 4 | expensive_review |
Constraints
State the output contract first, use readable CTE layers, return the exact columns requested by the prompt, and use deterministic ordering.
Expected skills
Interview clarification, SQL structure, edge-case handling, and final-answer narration.
Run the SQL query to inspect preview rows.