The principle
Every product that stores events eventually gets asked for a report nobody planned. The demands diverge: they cannot be enumerated, and they cannot be guessed.
So the storage must not bend to them. Designing the shape around one particular analysis freezes that query into the data, and the next one still has nowhere to go.
What does not freeze anything is an index: it sits beside the data, it can be added later, and it changes nothing about how the data is stored. So the demands are served with indexes, and the storage stays what it is.
What it costs
A fixed shape cannot answer every question. Our has_props
column and the three typed property maps are the compromise: a report
that filters by a property value reads the map column of the fact table
(6.5 ms) instead of two columns of a narrow table (0.6 ms). The
loss is on the record, and the second layer — a wide table plus
light aggregate views — is where it is meant to be paid back.
What it buys
The same rule is why the columns keep their types. A number is a number and a date is a date, so a report can compare them without turning them into text first — and an index on a typed column is a real index.
The experiment report has the four stories behind the decision, with the numbers that chose it.