Skip to main content

Module jit_promotion

Module jit_promotion 

Source
Expand description

On-demand promotion of fine JIT partitions into coarser ones On-demand promotion of fine JIT partitions into coarser ones.

A query over a long range plans coarse buckets (see partition_ladder). When a closed bucket is already covered by several finer partitions, they are merged into one, so that this query and the following ones read a few large files instead of many small ones. The work is optional: it never fails the query, and it skips instead of waiting when another query is already on it.

Structs§

PromotionTarget
A closed bucket whose covering partitions should be merged into one.

Functions§

is_promotable
Whether inputs are worth merging: at least two of them, within the object cap and the byte cap on their summed file_size, all written with the same file schema.
promote_closed_buckets
Merges each target’s partitions into one, in turn. Never fails: a target that errors is logged and counted, and the query still reads a complete set of partitions because a merge retires its inputs in the same transaction that inserts the result.
promotion_candidates
Picks the buckets to promote. A pure function of the planner output, the verdicts and the candidate rows: no object storage is read. A bucket qualifies when the planner emitted it closed at the query’s rung (not descended), it was judged covered by at least two of its own rows, and those rows fit the object cap with a single schema hash.