Brief
Reduce and estimate the data scanned by a warehouse query using a partition filter, a dry run, and a limit.
Mara gets a message from Voss: 'Query the whole table and publish the number now.' Imani first wants the two nights around the crash and the preserved source files. Propose a narrow query, explain its imaginary data volume, and refuse to treat a row count as final proof. The meeting is urgent in the story; the exercise has no timer.
Your mission
- Explain why originals are kept as files while counts use a table copy.
- Name the column and two-date range the query filters.
- Calculate volumes for two days and 30 days, then compare them.
- Explain a dry run, a 5 GB limit, and why LIMIT 10 cannot replace the filter.
How to check your work
- Object storage for files; warehouse for table analysis.
- event_date from April 12 through 13, 2026.
- 4 GB versus 60 GB; the month scans 15 times as much in this model.
- Dry run estimates; a limit can reject a broad query; LIMIT alone does not prune partitions.
Course example
This version runs in the workspace's SQLite database. The warehouse syntax shown in the lesson needs its own tool.
SELECT event_date, COUNT(*) AS observations FROM telemetry_events WHERE event_date BETWEEN '2026-04-12' AND '2026-04-13' GROUP BY event_date ORDER BY event_date;
SQLite schema and synthetic input
CREATE TABLE telemetry_events (event_date TEXT NOT NULL, event_id TEXT PRIMARY KEY);
INSERT INTO telemetry_events VALUES ('2026-04-12', 'E1'), ('2026-04-12', 'E2'), ('2026-04-13', 'E3');