execbuilder

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const ParallelScanResultThreshold = 10000

ParallelScanResultThreshold is the number of results up to which, if the maximum number of results returned by a scan is known, the scan disables batch limits in the dist sender. This results in the parallelization of these scans.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {

	// IsDDL is set to true if the statement contains DDL.
	IsDDL bool

	// ContainsFullTableScan is set to true if the statement contains an
	// unconstrained primary index scan. This could be a full scan of any
	// cardinality.
	ContainsFullTableScan bool

	// ContainsFullIndexScan is set to true if the statement contains an
	// unconstrained non-partial secondary index scan. This could be a full scan
	// of any cardinality.
	ContainsFullIndexScan bool

	// ContainsLargeFullTableScan is set to true if the statement contains an
	// unconstrained primary index scan estimated to read more than
	// large_full_scan_rows (or without available stats).
	ContainsLargeFullTableScan bool

	// ContainsLargeFullIndexScan is set to true if the statement contains an
	// unconstrained non-partial secondary index scan estimated to read more than
	// large_full_scan_rows (or without without available stats).
	ContainsLargeFullIndexScan bool

	// ContainsMutation is set to true if the whole plan contains any mutations.
	ContainsMutation bool
	// contains filtered or unexported fields
}

Builder constructs a tree of execution nodes (exec.Node) from an optimized expression tree (opt.Expr).

func New

func New(
	factory exec.Factory,
	optimizer *xform.Optimizer,
	mem *memo.Memo,
	catalog cat.Catalog,
	e opt.Expr,
	evalCtx *tree.EvalContext,
	allowAutoCommit bool,
) *Builder

New constructs an instance of the execution node builder using the given factory to construct nodes. The Build method will build the execution node tree from the given optimized expression tree.

catalog is only needed if the statement contains an EXPLAIN (OPT, CATALOG).

If allowAutoCommit is true, mutation operators can pass the auto commit flag to the factory (when the optimizer determines it is correct to do so and `transaction_rows_read_err` guardrail is disabled.). It should be false if the statement is executed as part of an explicit transaction.

func (*Builder) Build

func (b *Builder) Build() (_ exec.Plan, err error)

Build constructs the execution node tree and returns its root node if no error occurred.

func (*Builder) BuildScalar

func (b *Builder) BuildScalar() (tree.TypedExpr, error)

BuildScalar converts a scalar expression to a TypedExpr.

Jump to

Keyboard shortcuts

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