Skip to main content

Module partition_ladder

Module partition_ladder 

Source
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§

PlannedBucket
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 range outward to whole rung buckets.
finer_rung
The rung right below rung, if any.
plan_buckets
Plans the buckets to materialize over insert_range (rung-aligned) for a query at rung.
plan_by_source_bytes
Tiles range with buckets that each cover at most cap source bytes (as measured by bytes), 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 at rung; only the open edge descends, down to finest. A bucket that begins at or after insert_range.end is dropped, so the open edge stops at the end of the range instead of planning empty future buckets.
select_rung
Largest rung r with range / r >= TARGET_BUCKETS_PER_QUERY; the finest rung if none.

Type Aliases§

BucketCount
Block and object counts of one non-empty finest-wide bucket, keyed by its start.
BytesFn
Source bytes of a bucket.