Where the properties live — four stories about one decision

A site's own events carry properties: the plan a visitor is on, the price of the thing they added to the cart, the variant they picked. **Where those live is one decision with four stories inside it** — and it is the decision that kept the collector's memory from exploding.

The four: the EAV table · the wide table (and why it is a map, not varchar, varchar) · why three types of map · the has-props bit and the mask we keep empty.

The three criteria we decided by (the owner, 2026-12-01)

  1. **A query must not blow the memory, and a spill must not turn into a slow

query.**

  1. Writing must not be slow — the collector is mostly writing.
  2. The disk must not be big. The hot tier does not matter much; **the cold

tier does** — that is the cost.

And a fourth line, which is the important one:

  1. **As for reading: there are far too many possible readings to design for.

That is what the second layer is for** — a wide table as the base and lightweight aggregate views on top.

Reading does not take part in this decision. Everything below is measured against 1, 2 and 3.

Story one: the EAV table (what v0.6 did)

One row per property, with the key, the value and the type of the value in columns, and the context of the event on the row.

It has one great property: it is narrow. A filter that reads one property value reads two columns of a small table. and it wins every read question we measured:

question (ms)EAVmaparrays
filter by a property value, count0.66.56.5
filter by a property value, aggregate0.68.67.4
filter by a property value, then take the event table's columns3.16.86.9
the property report (every property, by key)1.412.512.2
one page of events with their properties (our API)3.59.011.6
filter by a property value, plus the has_props flag0.64.73.6
a whole page read (our API's two questions)6.98.412.7

And it has three prices:

  1. It is a second table, so a join, so and a join's memory is the thing

we were trying to protect: at 4 million rows the EAV join peaked at 133.2 MiB in the process, against 39.0 MiB for the same question without the join. (The 128 MB limit and the 1 GB limit were equally fast — 50 ms — so the spill threshold is not in reach at this scale yet.)

  1. It is written twice — the event row and the property row.
  2. It is big: the properties' part is 13,880,845 B against 375,063 B

for the same properties in three map columns — 97% smaller.

And the decision was not to throw it away: the EAV table stays as a view to be derived later (which is what umami does with event_data_pivot_mv) — except that ours would have to keep the types, which umami's does not.

Story two: the wide table — why a map, and why not varchar, varchar

Three candidates, measured on 1,000,000 events and 690,000 property rows (our DuckDB 2.0, a 128 MB limit, two threads, median of 3×5 runs):

On the disk (the properties' part, Parquet with ZSTD):

shapebytes
the EAV table13,880,845
three map columns375,063 (+ 146,852 of offsets and validity)
six parallel arrays375,011 (+ 147,041)

The arrays and the map are the same on the disk, and both are 97% smaller than the EAV table.

On the write (the product's appender path, 1,000,000 events + 450,000 properties):

timepeak RSSthe hot tier file
EAV (two appenders)9.43 s355.7 MiB14,692,352 B
map (empty map)13.17 s369.3 MiB9,711,616 B
map (NULL)8.82 s384.7 MiB10,498,048 B
arrays (six columns)10.98 s406.0 MiB10,235,904 B

Two levers on the write, both measured: an empty map costs every row (three empty columns: 6.31 s for a million rows; EAV only writes a property row for 24% of the events). and NULL instead of an empty map is 33% faster (13.17 → 8.81 s). and one appender instead of two (on ClickHouse: 119 → 61 ms per batch).

The arrays are Plausible's shape (meta.key[] + meta.value[], and it runs in production). and on ClickHouse the arrays are 2.5× smaller than the map (946,184 B against 2,355,711 B). that is the one column the arrays win. but our map carries ZSTD(3) (the default codec of a map is LZ4). 559,022 B. so with our codec the map is 1.7× smaller than the arrays on ClickHouse too

And the arrays lose where it counts: the write is slower than the map's (10.98 s against 8.82 s, slower than the EAV's as well — six columns instead of three, each list carrying its own offsets and validity). and our own API's two questions are slower (a page of events 11.6 against 9.0 ms; a whole page read 12.7 against 8.4 ms). because they read six lists instead of three maps

The semantics differ too, and that is a decision, not a detail:

a missing keythe same key twice
EAVno rowthe later one wins
mapNULL (ClickHouse: 0)an error (one key, one value)
arraysNULL (the position is not found)both are kept

Story three: why three types of map — and what it costs the SQL user

The maps are not one map of strings: there are three, one per value type (props_string · props_number · props_date). so the value keeps its type.

What that buys:

  • a number is a number and a date is a date. a report can compare them without turning them into text first;
  • the type is in the schema. the dialect is the same on four engines (ClickHouse Map(String, …) · DuckDB MAP(VARCHAR, …) · PostgreSQL JSONB · SQLite TEXT).

What it costs:

  • the SQL user has to know the type. props_number['price'] > 100 and props_string['plan'] = 'pro' are different questions, and a filter that spans both has to say which one it means. that is real friction, and we chose it;
  • and it is a choice that has a date on it: Plausible chose varchar, varchar — every value is a string, the type is gone. that is not a mistake, it is a different moment: when we chose three maps, the main consumer of the data was an AI agent (which reads the shape, not a hand-written WHERE clause). and Plausible's choice was made when the consumer was a human writing SQL.

Our trade: we keep the types, so the SQL user has to know them, because the main consumer is an agent. their trade: the values are strings, so the SQL user does not have to know — and the agent gets the strings

And the engines do not agree about a missing key. ClickHouse returns 0, not NULL. so a filter must add mapContains, or the rows without that key are counted as zero. (there is a test for it). and PostgreSQL's JSONB drops the type and its GIN index only helps containment, not comparisons of values. that is PostgreSQL's price.

Story four: the has-props bit, and the mask we keep empty

The fact table has a column that says whether a row has properties. It is an integer, and it says which level: 0 none · 1 event · 2 session · 3 visit. and there is a second column, props_mask, which is always 0 for now. it is the site's own acceleration bits, and it is empty on purpose.

Why one integer instead of a boolean plus an integer (7.34M rows, 5% with properties, the properties scattered):

layoutthe hot tierthe cold tier"has properties""the session-level rows"
boolean + int3,158,016 B760,546 B2.30 ms2.57 ms
0-4 int + int2,633,728 B531,012 B1.96 ms1.66 ms
packed into one int (the level in the low bits, the flag in the high bits)2,633,728 B518,930 B2.01 ms2.20 ms (level filter)

One integer answers two questions — "has properties" is > 0, "which level" is = 2. and that is 35% faster than two filters (one filter against two). when the properties are scattered. (when they are clustered, the two are equal). the price: has_props is no longer a boolean, and the docs have to fix the 0-4 domain.

And one mechanism that decided the layout: the dimension being filtered must be its own column, with a small domain. pack it into another column's bits and the filter degrades into a bit test, which the row groups cannot skip: (x & 3) = 2 took 2.20 ms against x = 2's 1.71 ms — 29% slower. the owner's instinct ("not just an int column, because of the row-group skipping") was right

And why props_mask is added now, while it is still empty: a column added later is NULL on the old shards. and NULL & 8 is NULL, not 0. the acceleration's bit test would silently drop the historical rows. so it is added now, not when it has something to say

And a note on the domain: it stopped at {0, 1} for a while — boolean wins on the disk (0.109 against 0.216 B/row in the hot tier) and the integer only wins on the filter (1.11 against 1.50 ms, at the edge of the noise). the criterion is not "how big is the domain", it is "will it grow". and the migration is lossless (TRUE → 1, FALSE → 0). so the type can change whenever. what should be done now is the props_mask column, and its reason (NULL) has nothing to do with the domain

What we take away

  1. The EAV table wins every read question and loses on everything else, so

— it is not the storage layer any more; it is a view to derive later

  1. Three maps beat six arrays — the same on the disk, faster to write,

faster for our own API — and on ClickHouse they win 1.7× once the codec is right. and the arrays are Plausible's shape, which is why we measured them rather than guessing

  1. The types are worth their friction. because the main consumer is

an agent, and because a report should not turn a number into text to compare it. Plausible chose strings, in a different moment, for a different consumer

  1. **A flag that will be filtered on must be its own column with a small

domain. and the column that will hold bits must exist before the bits do. otherwise NULL & 8 quietly loses your history**

Caveats

1,000,000 events and 690,000 property rows for the three-way comparison; 7,340,000 rows for the flag layouts. Our DuckDB 2.0, a 128 MB limit, two threads, the median of 3×5 runs. A single run is not a number — and we once called "25% slower" a conclusion that turned out to be 6% when we re-measured.

A negative result we kept: naming the column in the SQL does not prune on either side — the narrower the filter, the flatter the time (EAV 29/31/31/30 ms, map 34/35/34/31 ms, across 10% / 1% / 0.1% / no filter). EAV's filter is 7–10× faster not because of pruning, but because it reads two columns of a narrow table.

The measuring tools are private; every number here was measured on the machine above, and the method is written down in the post itself.

Sumimi / 数咪咪 is an independent open-source project. It is an open-source alternative to Umami and implements the Umami v2 HTTP API; no Umami assets are used. Licensed under the Apache-2.0 licence. Third-party names are referenced nominatively.