SegmentSketch
Everything one segment's documents said about their shape.
Immutable, and the unit the whole catalog is built out of: one of these per live segment, folded with merge to produce the model of the store. Because the fold is over live segments, a compaction that rewrites two segments into one replaces two sketches with one automatically — there is no separate invalidation step and nothing to go stale.
The path budget is enforced here, and the overflow is reported rather than hidden. Beyond CatalogOptions.maxPaths distinct paths, the rest are folded into estimatedDroppedPaths and droppedObservations. Machine-generated field names — an object keyed by user id, a log line carrying a request id in the key — would otherwise make the path space a copy of the data.
Properties
Documents observed. Tombstones are not documents and are not counted.
Observations that belonged to a path beyond the budget.
Estimated distinct paths that did not fit the budget. Zero when nothing was dropped.
Total path observations, dropped ones included. Conserved by merge.
The paths this sketch tracks, in canonical order.
Functions
Every tracked path and its sketch, in canonical order.
What was observed at path, or null if it was never seen or was dropped.