Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build( blocks []*metastorev1.BlockMeta, maxReads, maxMerges int, ) *queryv1.QueryPlan
Build creates a query plan from the list of block metadata.
NOTE(kolesnikovae): At this point it only groups blocks into uniform ranges, and builds a DAG of reads and merges. In practice, however, we may want to implement more sophisticated strategies. For example, it would be beneficial to group blocks based on the tenant services to ensure that a single read covers exactly one service, and does not have to deal with stack trace cardinality issues. Another example is grouping by shards to minimize the number of unique series (assuming the shards are still built based on the series labels) a reader or merger should handle. In general, the strategy should depend on the query type.
func BuildBalanced ¶ added in v2.3.0
BuildBalanced builds a balanced query tree where each node of the tree has a similar number of blocks it needs to process compared to its siblings.
maxMerges must be at least 3. Binary merge trees cannot be balanced for an odd number of nodes: the leftover node becomes the only child of a merge node, which does no useful merging.
Types ¶
This section is empty.