D8LooPFocus modeCODE WORKSPACE
Return query_id, query_label, and partitions_scanned for queries whose partitions_scanned equals the table's partition count. Order by query_id.
Compare each run's partitions_scanned to the total partition count from table_partitions.
Sample input
| query_id | query_label | partitions_scanned |
|---|---|---|
| 1 | daily_active_users | 8 |
| 2 | orders_export | 8 |
| 3 | revenue_by_country | 2 |
| 4 | event_funnel | 6 |
| 5 | late_event_audit | 1 |
| 6 | adhoc_select_star | 8 |
| partition_day |
|---|
| 2026-01-01 |
| 2026-01-04 |
| 2026-01-08 |
Expected output
| query_id | query_label | partitions_scanned |
|---|---|---|
| 1 | daily_active_users | 8 |
| 2 | orders_export | 8 |
| 6 | adhoc_select_star | 8 |
Constraints
Compare partitions_scanned to (SELECT COUNT(*) FROM table_partitions). Keep only the equal rows and order by query_id.
Expected skills
Full-scan detection from query history and partition metadata.
Run the SQL query to inspect preview rows.