query_plan

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Type NodeType
	// contains filtered or unexported fields
}

func (*Node) Blocks

func (n *Node) Blocks() iter.Iterator[*metastorev1.BlockMeta]

func (*Node) Children

func (n *Node) Children() iter.Iterator[*Node]

func (*Node) Plan

func (n *Node) Plan() *QueryPlan

Plan returns the query plan scoped to the node. The plan references the parent plan blocks.

type NodeType

type NodeType uint32
const (
	NodeRead NodeType
	NodeMerge
)

func (NodeType) String

func (t NodeType) String() string

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.

func Open

func Open(p *queryv1.QueryPlan) *QueryPlan

func (*QueryPlan) Proto

func (p *QueryPlan) Proto() *queryv1.QueryPlan

func (*QueryPlan) Root

func (p *QueryPlan) Root() *Node

Root returns the root node of the query plan.

func (*QueryPlan) String

func (p *QueryPlan) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL