Expand description
Aligned bucket ladder and planner sizing JIT partitions from the query range Aligned bucket ladder (minute, 5 min, 15 min, 30 min, hour, 6 h, day) used to size JIT partitions from the query range, and the planner that turns per-minute block counts into the buckets to materialize.
Every rung divides the next one and duration_trunc aligns to the Unix epoch, so buckets of
different rungs nest and never straddle each other.
Structs§
- Planned
Bucket - One insert-time bucket the planner decided to materialize.
Constants§
- LADDER
- Bucket widths, finest first. Each rung divides the next one.
- TARGET_
BUCKETS_ PER_ QUERY - How many buckets a query should be spread over, give or take a rung.
Functions§
- align_
outward - Truncates
rangeoutward to wholerungbuckets. - finer_
rung - The rung right below
rung, if any. - plan_
buckets - Plans the buckets to materialize over
insert_range(rung-aligned) for a query atrung. - plan_
by_ source_ bytes - Tiles
rangewith buckets that each cover at mostcapsource bytes (as measured bybytes), except at the finest rung, where a bucket is emitted whatever its size. The result is ascending and has no gap. - plan_
dense_ buckets - Plans the buckets to materialize over
insert_range(rung-aligned) when no per-bucket count is available: every bucket is assumed non-empty and none descends on object count. A closed bucket is emitted atrung; only the open edge descends, down tofinest. A bucket that begins at or afterinsert_range.endis dropped, so the open edge stops at the end of the range instead of planning empty future buckets. - select_
rung - Largest rung
rwithrange / r >= TARGET_BUCKETS_PER_QUERY; the finest rung if none.
Type Aliases§
- Bucket
Count - Block and object counts of one non-empty
finest-wide bucket, keyed by its start. - BytesFn
- Source bytes of a bucket.