The setup
A local umami v2.20.2 on PostgreSQL 15.20, snapshot of 2026-11-27, eight sites:
| events | 7,344,377 = 7,325,792 page views + 18,585 custom events |
| visitors / sessions | 2,307,917 distinct session_id · 4,600,970 distinct visit_id |
| the period | 2023-03-09 → 2026-11-27 |
| the properties and the revenue | zero rows — the property mapping cannot be checked on this data (it needs another sample) |
| a hole in the session table | 60,957 of the visitors in the events (2.6%) have no session row — their dimensions are empty after the import |
Three levers, in this order
Everything below is the same 7,344,377 rows, exported to Parquet with ZSTD.
| size | per row | |
|---|---|---|
| A · umami's own tables (26 columns, its uuids) | 397.6 MB | 54.1 B |
| B · our shape (51 columns) + their ids | 560.7 MB | 76.3 B |
| B' · the same + their ids + sorted by time | 427.7 MB | 58.2 B |
| C · our shape + our ids | 225.6 MB | 30.7 B |
Lever one: the shape makes it bigger
A → B is +22.2 bytes a row (+165 MB, +43%). That is not a mistake — it is the price of our shape:
- umami stores the visitor's dimensions once, in a session table of 2.2M rows; we carry them on every event row — 7.3M of them;
- and we carry one more column (
session_start).
Our shape is bigger on purpose, because a report never has to reach for a second table. The price has to be paid back twice over, and it is.
Lever two: the ids are the saving
| column | their id | our id | the difference |
|---|---|---|---|
event_id | 16.00 B/row | 0.68 B/row | −15.32 |
visit_id | 10.00 B/row | 1.12 B/row | −8.88 |
session_id | 10.07 B/row | 4.68 B/row | −5.39 |
| together | 36.07 | 6.48 | −29.59 B/row (−217 MB) |
Ours are not random uuids. event_id and visit_id are a v8 uuid made of one random half per instance plus a dense counter, so the random half is the same on every row (the dictionary eats it) and the counter is dense (the engine's difference code eats it). umami's three are random uuids. and a random uuid does not compress
Lever three: the row order is free
Same data, same columns, same ids — sorted by time: −8.5 bytes a row (−130 MB, −24%).
One column explains most of it: page_title differs by 8.5 bytes a row on its own. the same titles, next to each other, are what ZSTD can actually compress. and the same trick works on our cold tier's shards
The net
225.6 MB against umami's 397.6 MB — 43% smaller, and ours has 51 columns against umami's 26.
The answer to the question we set out to answer: the id rewrite can be done cheaply, and it saves more than the reshape costs — +165 MB for the shape, −217 MB for the ids, and −130 MB for the order on top.
The efficiency of it
The rewrite is two row_number()s and the first 8 bytes of an md5:
7,344,377 rows in 8.4 seconds
The "expensive" transformation is the cheap one.. What was expensive was the shape — and we paid it knowingly, because the reports never have to reach for a second table
The whole thing, end to end
Then the import itself: the rows land in the cold tier, as a standard Iceberg table — not a private format, with the field ids Iceberg asks for.
| on disk (the cold tier) | 310,253,706 B (42.2 B/row) |
| umami's live PostgreSQL database | 12,963,655,015 B, so 41.8× smaller |
| the same data as ZSTD Parquet | 225,579,945 B — 57.5×, so the Snappy copy is 37.5% bigger than the ZSTD one |
That 37.5% is the engine's writer, not our design: DuckDB's Iceberg writer only offers Snappy, and our own writer writes ZSTD. it will be fixed when the engine's writer can be told what to do
The numbers come out identical, item by item: 2,878,342 page views · 642,990 visitors · 1,350,876 visits · 990,269 bounces · 53.58 s average — the same as umami's
Four things can read it: our own reports (the command line too: sumimi summary <site> --from 2023-01-01 --to 2026-12-31 — 2,878,342) · DuckDB · pyiceberg · anything that speaks Iceberg
And the product's path has no "convert the Parquet into a DuckDB file" step. the imported rows go where old rows go — the cold tier — and the hot tier's file does not hold them
What the rewrite costs, said plainly
- The rewritten ids no longer correspond one-to-one with umami's., so to reconcile the books you need the mapping: 2,307,917 visitors + 4,600,970 sessions — two small tables, optionally exported.
- The rewritten
event_id/visit_idbelong to this instance, so they are only meaningful here — which is what our ids are defined to be. session_idis the first 8 bytes of an md5, not our own hash, so the same visitor must still line up before and after the migration. the mapping table is the only thing that can do that
What we take away
- A migrated database's size is decided by three levers: the shape, the
ids, and the row order. Ours: +165 MB, −217 MB, −130 MB.
- The shape is the expensive one, and it is bought on purpose — a report
never reaches for a second table.
- The rewrite is cheap (8.4 seconds for 7.3M rows). so the question
is never "can we afford to rewrite the ids" but "should the shape have been different".
- The order is free. the same reasoning that took 8.5% off our
Parquet shards takes 24% off a migrated database.
Caveats
- Two different comparisons, and they are not the same one. 397.6 MB against 225.6 MB is table against table (both as Parquet) — 43% smaller. The 12.96 GB against 310 MB is database against database (umami's live PostgreSQL, with its indexes, its materialized summaries and its dead space, against our cold tier) — 41.8× smaller. Only the first one is apples to apples.
- The properties were not on this data (umami's
event_datahad zero rows), so the property mapping needs another sample - 2.6% of the visitors have no session row, so their dimensions are empty after the import (in an older snapshot it was 15% — the newer data is much better.)
- The measuring tools are private; every number here was measured on the machine above, and the method is written down in the post itself.