Data quality scorecard · warehouse cost
On 54 days of public trip data loaded day by day, the last run of a full rebuild read 49 times the data and 49 times the rows of an incremental model on a date-partitioned, clustered table, which published the same tables as a full rebuild under all 8 planted faults; the common incremental model on a date key skipped rows in 4 of them, as its design implies.
A full rebuild re-reads all history on every run, so its run grew by about 1.6 MB of data for each day of history, to 86.5 MB on day 54; the partitioned model stayed between 1.0 and 2.2 MB a run. The date-key model reads two whole columns of its table on every run, the trip date to find the newest date it holds and the trip ID for its delete, so it grew by about 0.6 MB a day, to 20 times the partitioned model's data on the last run. Of the scorecard's checks, only a per-day count of landing rows against the model saw it publish 3 days short. Checks that look only at trip dates newer than yesterday's, the same filter the date-key model uses, missed the blank fares in the late day and the faulty backfill; the same checks run on each morning's load batches caught both, for about the same cost.
| Last daily run, full rebuild against partitioned49 times the data86.5 MB against 1.8 MB after 54 days of history; 49 times the rows and 30 times the CPU seconds | Incremental on a date key, unpartitioned20 times the partitioned model's dataon the last run: deleting earlier copies of the new trips read the trip ID column of the whole table, 33.8 MB of its 35.6 MB; the gap grows with history | Faults the date-key model skipped4 of 8a late day twice, the second half of a day and a faulty backfill, by its design; the landing count flagged the 3 that left a day short, and the units check on the landing table caught the backfill | Checks on new trip dates only2 faults missedthe late day's blank fares and the faulty backfill, which the same checks on each morning's load batches caught; whole-history checks read 148 MB a morning by the end, against 3.9 MB for the morning batch |
Main limitation 54 days of a one-in-eight sample of public trips (1.4 million rows) as parquet files read by DuckDB on one shared machine. Bytes are counted from file metadata, not billed by a warehouse; I wrote the faults, and every fault outcome follows from each model's design. | |||
What each run read
MB of data read per run, one run per daily file.
Full rebuildIncremental on a date keyPartitioned and clustered
Show the data
| Model | Last run, data read | Last run, rows read | Last run, CPU | January, data read | February, data read | February, rows read | February, data written |
|---|---|---|---|---|---|---|---|
| Full rebuild | 86.5 MB | 2,804,428 | 1.59 s | 0.73 GB | 1.56 GB | 50,690,576 | 1.49 GB |
| Incremental on a date key | 35.6 MB | 2,804,481 | 0.15 s | 0.32 GB | 0.65 GB | 50,691,542 | 0.03 GB |
| Incremental, partitioned and clustered | 1.8 MB | 57,526 | 0.05 s | 0.05 GB | 0.04 GB | 1,264,298 | 0.03 GB |
On the first day all three models read the same 1.6 MB: one file. By February 23 the full rebuild read 2,804,428 rows on every run, the whole landing table plus the rebuilt cleaned table it aggregates, and wrote the whole cleaned table again. Over February's 23 runs it read 1.56 GB, 41 times the partitioned model's 38.6 MB.
The date-key model shows where incremental savings leak. It reads only the new day's rows from the landing table, but making each trip appear once means deleting any earlier copy of the new trips, and on a table with no partition to narrow the search that reads the trip ID column of every file. Finding which dates are new reads the trip date column of every file too, for the newest date already loaded. Its rows read (2,804,481 on the last run) match the full rebuild's because both whole-table reads count every row: 1,373,504 rows for the newest date (0.01 MB of data, since a date column compresses to almost nothing) and the same rows for the delete (33.8 MB, 95% of its data). The rest is the new day's 28,710 landing rows and the published table. Its bytes are 2.4 times smaller than the full rebuild's only because a trip ID is a fraction of a row. That is how this pattern behaves on an engine that bills by data scanned. The partitioned model looks for earlier copies only inside the days the new file touches. (This split of the date-key model's reads was computed after the results, from the clean run's table files, with the same accounting; its rows are checked against the recorded runs, and the published-table bytes are the remainder: date-key-split.json.)
CPU seconds follow the rows. February's runs, replayed three times from the same starting state, used 30.1 CPU seconds for the full rebuild (30.1 to 30.4), 3.0 for the date-key model and 1.1 for the partitioned model, measured on a shared machine; every row, byte and file count was identical in all three replays.
What the incremental models hid, and which check caught it
Each fault replays February on its own copy of the tables, from the clean run's state after January 31. The full rebuild and the partitioned model published exactly what a full rebuild of the same landing table gives on every fault: a fault in the data reached their published table, as it should, so a check has something to find. The date-key model loads only trip dates newer than the newest it holds, so it skipped every row that arrived for an older day. That follows from its definition; the runs confirm it and show which checks noticed.
| Fault | Date-key model | Each morning, by load batch | Each morning, new trip dates only | Whole history, at the clock |
|---|---|---|---|---|
| Missing day The February 23 file never arrives. | Same as a full rebuild | Freshness | Freshness | Freshness |
| Missing fares 30% of February 22 fares arrive blank. | Same as a full rebuild | Missing-fare limit, missing-fare anomaly | Missing-fare limit, missing-fare anomaly | Missing-fare limit, missing-fare anomaly |
| Rows sent twice One in twelve February 22 rows is delivered again, unchanged, at 01:30 the next day. | Same as a full rebuild | Duplicate content, duplicate trip IDs | Duplicate content, duplicate trip IDs | Duplicate content, duplicate trip IDs |
| Kilometres as miles Every February 22 distance arrives multiplied by 1.609344. | Same as a full rebuild | Units check | Units check | Units check |
| Late day The February 17 file arrives two days late, with February 19's. Its rows are fine. | February 17 missing | Freshness, landing count (date-key model) | Freshness | Landing count (date-key model) |
| Late day with missing fares The same late February 17 file, with 30% of its fares blank. | February 17 missing | Missing-fare limit, missing-fare anomaly, freshness, landing count (date-key model) | Freshness | Missing-fare limit, missing-fare anomaly, landing count (date-key model) |
| Faulty backfill February 2 to 8 are delivered again at 04:00 on February 24, same trips, with distances multiplied by 1.609344. | February 2 to 8 not restated: the bad distances never loaded | Duplicate content, duplicate trip IDs, units check | Missed | Duplicate content, duplicate trip IDs, units check |
| Day in two halves February 23 arrives as two halves, at 01:00 and 05:00 on February 24. | February 23 short by half | Landing count (date-key model) | Landing count (date-key model) | Landing count (date-key model) |
A backfill re-sends trips already loaded, so the duplicate trip ID check flags every backfill, faulty or not; the units check is the one that saw this backfill was wrong. Its zero-distance trips came back unchanged, which is what the duplicate-content check flagged.
Three things stand out. First, the faulty backfill: the date-key model never loaded it, so its published table stayed right by accident, while the full rebuild and the partitioned model faithfully loaded the bad distances. Only a check on the landing table could see it, and checks that follow the incremental filter never look there. Second, the late day: freshness flagged it the morning it was due, but when it arrived, only checks that read each morning's load batches looked at its blank fares. Third, the rows sent twice never reached any published table, because every model keeps one row per trip, so only the duplicate checks on the landing table caught them; checks on the models would have passed.
The landing count, the per-day count of distinct trip IDs in the landing table against the cleaned and published tables, is the check that catches a model that leaves a day short: it flagged February 17 and February 23 in the date-key model and nothing in the other two. Run on new trip dates only it missed the late day too, because the late day is not a new date.
What the checks cost, and what they flag on clean data
The scorecard ran its checks once over the whole month. Kept that way, they read the whole history every morning, so an incremental model with whole-history checks still pays close to a full rebuild's scan each day: on the last morning they read 148.4 MB, against 86.5 MB for the full rebuild's run.
| Scope | Landing-table checks | Model checks, partitioned | Model checks, full rebuild |
|---|---|---|---|
| Whole history, at the clock | 80.1 MB | 68.3 MB | 70.1 MB |
| Each morning, by load batch | 2.5 MB | 1.4 MB | 37.2 MB |
| Each morning, new trip dates only | 2.5 MB | 1.4 MB | 37.2 MB |
The morning scopes read the new batch plus the date and fare columns of the 40 days before it, for the day-volume and anomaly baselines, so their landing-table checks stayed between 1.0 and 2.9 MB a morning over the whole run. The full rebuild's model checks cost more than the partitioned model's in every scope because its rebuilt table is written in the order its deduplication leaves it, so no file statistic narrows a date.
On the clean history every scope flagged the same two things. The duplicate-content check flagged 21 of the 54 days: at about 25,000 trips a day, a few pairs of different trips share every field it compares. And the units check flagged one trip on January 24 with no distance. Both checks were sized on a month of 300 trips a day; on real volume the duplicate-content rule needs the start time in its key, and the units rule needs to treat a missing distance apart. Those flags were left out when counting what each scope caught.
Partitions and clustering: the query side
Three analyst queries ran on each model's cleaned table every morning, with the same answers in every model. On the last morning:
| Query | Full rebuild | Incremental on a date key | Incremental, partitioned and clustered |
|---|---|---|---|
| One day, by pickup area | 3.53 MB | 0.05 MB | 0.02 MB |
| One area, last 28 days | 11.33 MB | 5.64 MB | 2.30 MB |
| One area, all history | 2.42 MB | 2.45 MB | 0.54 MB |
Partitioning by date pays on any query with a date filter; clustering by pickup area pays on queries that filter on area, inside or across days. The date-key model's files happen to hold one load day each, so file statistics skip by date almost as well as folders do, but nothing skips by area. A key lookup by trip ID gets nothing from either.
A one-screen decision rule
- A full rebuild is still fine while the history is short or the table small enough that re-reading all of it every run costs less than anyone would notice. That threshold arrives fast: here the full rebuild's run passed ten times the partitioned model's data on day 9. It is also the safest recovery path, because it can never skip a late row: keep it as the recovery, not the schedule, once runs grow with history.
- Go incremental when the run grows with history and the history keeps growing: here every day of history added about 1.6 MB to every full rebuild run. Pick the load filter by load batch or load time, not by the event date, or every late row, every day that arrives in parts and every backfill is silently skipped.
- Partition the incremental table by the date of its key events as soon as it merges or deletes by key. Without partitions, the delete reads the key column of the whole table on every run, which here was 20 times the partitioned model's data on the last run. Cluster by the column analysts filter on most.
- Move the checks with the model. Run them each morning on the load batches that arrived, not on new event dates and not on the whole history, and add one per-day count of distinct IDs in the landing table against the model. That count catches a model that leaves a day short; a restatement it skipped shows only in checks on the load batches.
In plain words
A daily-loaded table keeps growing. A model that rebuilds everything from the raw files on every run costs a little more every day; an incremental model touches only what changed. The cost saving is easy to measure; what a data lead also has to know is what the incremental model quietly skips, and whether the data checks still see it. I loaded the same public trips day by day into three versions of the same models, measured what each run read, then planted eight faults and ran the scorecard's checks three ways.
- Landing table
- Every file as it arrived.
- Cleaned table
- One row per trip, what analysts query.
- Published table
- The daily numbers a dashboard reads.
- Incremental on a date key
- Each run loads rows with a date newer than the newest already loaded.
- Partition
- A folder per trip date, so work on one day skips the rest.
- Clustering
- Rows sorted by a column inside each partition, so a filter on it skips blocks.
- Load batch
- The files that arrived since the last check, whatever dates they carry.
- Backfill
- Old days delivered again, to restate them.
What should hold in a warehouse, and what should not
These are expectations from how each model works, not measurements.
- The growth: should hold. A full rebuild reads all history on every run, so its ratio to a partitioned model grows with the days kept. Not measured here: extending this run's straight line to a year of history would put it in the hundreds.
- The delete cost of an unpartitioned table: depends on the engine. Engines that keep key statistics or indexes skip some of it; on scan-priced engines a merge without a partition filter reads the whole key column.
- The skipped faults: hold at any size. They follow from the date filter, not from volume.
- CPU: depends on the engine. One thread here; a warehouse spreads a full rebuild over many workers, which shortens it but bills the same work.
Limits
- 54 days, not the months or years a warehouse keeps: the city's query service stopped answering for this dataset partway through the download. The growth per day is the result; longer histories extend it in a straight line by construction, since a full rebuild reads every day kept.
- A one-in-eight time-slot sample, 16,749 to 35,779 trips a day. Rows and bytes scale with volume; the ratios between models do not.
- Bytes are the compressed parquet bytes of the columns each step reads, in the files and row groups its filters cannot skip, counted from file metadata. DuckDB's own row counter counted every row of each file it opened, so it is kept in the results as the engine's figure, not used here.
- CPU seconds come from one process on one DuckDB thread, on a shared machine, and include its fixed costs; they are a check that work follows rows, not a timing.
- Eight faults, written by me, not blind, with sizes taken from the scorecard's. Every published-table outcome follows from the models' definitions. The code's development runs used the same days, so the outcomes were seen once before the measured run, after the predictions were written, and two summary rules were added after that (see "Decided before the runs").
- No price is applied: rows and bytes, not money.
Use this at your company
To measure the models of a pipeline of your own the same way, paste this prompt into an AI assistant that can query your warehouse.
This method comes from Diogo Travassos's study "Data quality scorecard: warehouse cost" (https://diogotravassos.dev/data-quality-scorecard/warehouse-cost.html). If you can open links, read it first: it works the method through end to end and shows the checks that caught mistakes. The steps below stand on their own if you can't. Help me measure what each run of our daily models reads as the history grows, under a full rebuild and under incremental models, and whether our data checks still catch bad loads once the models are incremental. Data you need from me: the landing table with a load time and batch ID on every row, the cleaned table keyed on a row ID, the published daily table, our data checks, and at least a month of load history. Method: 1. Build the same models three ways on a copy of the history: a full rebuild every run, an incremental model that loads rows newer than the newest date already loaded, and an incremental model that loads every batch it has not processed yet into a table partitioned by date (and clustered by the column people filter on most). 2. Replay the history one daily load at a time. For every run, record the rows and bytes read after partition and file-statistics skipping, the rows and bytes written, and CPU seconds. Plot them against the days of history. 3. Replay the last month again with planted faults: a missing day, a day of blank values, rows sent twice, a unit change, a day that arrives late, a late day with bad values, a backfill with bad values, a day that arrives in two parts. 4. Run the checks three ways each morning: over the whole history, over only the batches that arrived since yesterday, and over only dates newer than yesterday's newest. Add a per-day count of distinct row IDs in the landing table against the cleaned and published tables. Checks before trusting the answer: - Confirm all three models publish the same daily table on the clean history, and every query returns the same answer. - Replay the last month at least three times from the same starting state; rows, bytes and files must repeat exactly. - Run every check on the clean history first, and count a planted fault as caught only on a day the clean run did not flag. Report back: the ratio of a full rebuild's rows and bytes to the partitioned model's on the last run, how each grows per day of history, which faults the date-key model skipped and which check caught each, what the checks cost per morning in each scope, and the limits: how much data, how many runs, and on what machine. In your report, say which study you followed and link it: https://diogotravassos.dev/data-quality-scorecard/warehouse-cost.html
Method and checks
Data
City of Chicago, Transportation Network Providers Trips, through the city's public query service: every trip that started in the first 15-minute slot of every second hour, January 1 to February 23, 2023, one file per trip day (1,402,214 trips). Trip IDs are replaced by a hash, no location finer than the community area is kept, and a missing area becomes area 0, as in the scorecard's sample. Each file's address, SHA-256 and row count are in the data notes. Each day lands at 01:00 the next day.
The models
All three build the same two tables from the same landing files: a cleaned table with one row per trip (the row from the latest load wins) and a published table with one row per trip date (trips, fares present, fare sum, miles, seconds). All files are parquet, written and read by DuckDB on one thread, with row groups of 8,192 rows.
- Full rebuild. Every run reads every landing file, keeps the latest row for each trip, and rewrites the cleaned and published tables.
- Incremental on a date key. The common incremental pattern on a date key, on an unpartitioned table. Each run loads landing rows with a trip date later than the newest one already in the cleaned table, deletes any earlier copy of those trips (which reads the trip ID column of the whole table), appends the new rows as one file, and recomputes the published days it loaded.
- Incremental, partitioned and clustered. Incremental on a table with one folder per trip date, rows sorted by pickup area inside each day. Each run loads the landing files it has not processed yet, whatever their trip dates, rewrites only the days they touch (keeping one row per trip), and recomputes those published days.
Tools: DuckDB 1.5.6, pyarrow 26.0.0, Python 3.12.3.
Checks and scopes
The scorecard's version 2 checks, rewritten as SQL: on the landing table, freshness (no file for more than 12 hours), the 5% missing-fare limit, day volume (under 0.6 times the median of the 14 days before), duplicate trip IDs, duplicate content, the units check and the missing-fare anomaly rule; on each model, unique trips, the model against its published table, and the landing count. Three scopes: the whole history at the clock (06:00 on February 24), and every morning at 06:00 on the batches that arrived since the morning before, or on trip dates newer than the newest one the morning before. A fault counts as caught when a check flags one of its planted days on a morning, and the clean run's same check and scope did not flag that day.
Runs and machine
One clean run of 54 days (each model runs once per file), eight fault replays of February and three more clean replays of February, each from the clean run's state after January 31. Machine: AMD Ryzen 7 5800 8-Core Processor, 16 threads, 35 GB, Linux under Windows, shared with other work. Every row, byte and file count repeated exactly across the replays, and every query answered the same in all three models.
Decided before the runs, and what changed
The models, faults, checks, scopes, measures, predictions and the headline rule were written down and committed before any download. Five changes followed before any outcome was seen: downloads without server-side ordering; rows read counted from file metadata, because DuckDB's counter ignored row-group skips; month-end checkpoints at the morning after a month's last file; freshness flags the day that was due; the new-dates watermark is the newest date the morning before. The history was then cut twice, from thirteen months to six and then to the 54 days fetched before the query service stopped answering, with the faults moved to February and the whole-history checks and the queries run every morning. The development runs had used these same days and faults, so the fault outcomes and the last day's ratios had been seen once by then. Two summary rules were added after that, still before the measured run: a planted day counts as caught only when the clean run did not flag it too, and whole-history flags count at the clock. The first can only remove catches. It removed duplicate-content flags on February 4 and 5 from the backfill and on February 23 from the day in two halves, flags the clean run raised on the same days; without it the new-dates checks would have counted the backfill as caught, from their flags on February 4 and 5, raised weeks before the backfill arrived. The second changed no catch (rule-effects.json, computed after the results).
Four of the six predictions held: the date-key model read between a tenth and a half of the full rebuild's data on the last run; CPU seconds followed rows; the date-key model differed from a full rebuild on exactly the four predicted faults and the other two models on none; whole-history checks grew with history while the morning scopes stayed flat. The first prediction was not met and could not be tested as declared: it expected about 12 million rows read by the last full rebuild and a last-day ratio in the hundreds after thirteen months; after 54 days the full rebuild read 2,804,428 rows and the ratio was 49. The checks prediction held in part: new-dates checks missed the late day's fares and the backfill, and the landing count caught the date-key model's short days, but it said only a reconciliation could see the clean late day, and after the freshness change freshness flagged it in both morning scopes. It was also too narrow on the rows sent twice, which were caught on new dates too, because they arrived with their own day.
The scorecardPipeline costDesignResultsData notesReproduce it