Skip to main content

Module postings_ops

Module postings_ops 

Source
Expand description

Set operations over postings: intersection, union and difference.

A label matcher plan is a tree of these operations over the postings lists of single label pairs, e.g. {namespace="prod", service="api"} becomes Intersection(postings(namespace=prod), postings(service=api)).

Every operation is lazy and keeps both inputs as cursors, so a plan costs one Postings per leaf and never materialises an intermediate set. Each seek is forwarded to the inputs, which lets the intersection skip large gaps instead of stepping through them.

Structs§

Difference
Difference left \ right: references in left that are absent from right.
Intersection
Intersection of two postings lists: references present in both.
Union
Union of several postings lists: every reference, once, ascending.

Functions§

difference
left minus right.
intersect
Intersection of two sources, boxed inputs.
intersect_all
Intersection of all sources; an empty input yields an empty list.
union_all
Union of all sources; an empty input yields an empty list.

Type Aliases§

BoxPostings
A boxed postings source, the currency of this module.