Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryPlan ¶
type QueryPlan struct {
// contains filtered or unexported fields
}
QueryPlan represents a physical query plan structured as a DAG. Each node in the graph can either be a "merge" or a "read" operation (leaves). Merge nodes reference other nodes, while read nodes reference data blocks.
func Build ¶
func Build( blocks []*metastorev1.BlockMeta, maxReads, maxMerges int64, ) *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.