Skip to main content

Module range

Module range 

Source
Expand description

Chunk selection by time range.

A series’ chunks are stored in ascending time order, so a query range can be turned into a contiguous slice of the chunk list without decoding anything: binary search for the first chunk whose max_time reaches the range start, and stop at the first chunk that begins after the range end.

This is the block-internal optimisation the query layer relies on; deciding which range a PromQL expression needs (e.g. the extra five minutes for rate(...[5m])) belongs to the query layer, not here.

Functions§

chunk_index_range
Index range of the chunks of a series that can hold samples in range.
chunks_in_range
The chunks of chunks that can hold samples in range, in time order.