package
19.2.12+incompatible
Repository: https://github.com/cockroachdb/cockroach-gen.git
Documentation: pkg.go.dev

# README

The opt package defines common high-level interfaces and classes that multiple sub-packages share. None of these definitions depend on any sub-packages, so all sub-packages can therefore depend on opt without causing cyclical dependencies (which Go does not allow).

# Packages

Package bench houses benchmarks for the SQL optimizer.
Package cat contains interfaces that are used by the query optimizer to avoid including specifics of sqlbase structures in the opt code.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package ordering contains operator-specific logic related to orderings - whether ops can provide Required orderings, what orderings do they need to require from their children, etc.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AggregateIgnoresNulls returns true if the given aggregate operator has a single input, and if it always evaluates to the same result regardless of how many NULL values are included in that input, in any order.
AggregateIsNullOnEmpty returns true if the given aggregate operator has a single input, and if it returns NULL when the input set contains no values.
BoolOperatorRequiresNotNullArgs returns true if the operator can never evaluate to true if one of its children is NULL.
ColSetToList converts a column id set to a list, in column id order.
DepByID is used with AddDependency when the data source was looked up by ID.
DepByName is used with AddDependency when the data source was looked up using a data source name.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MakeColSet returns a set initialized with the given values.
MakeOrderingColumn initializes an ordering column with a ColumnID and a flag indicating whether the direction is descending.
NewTableAnnID allocates a unique annotation identifier that is used to associate arbitrary data with table metadata.

# Constants

AggDistinct is used as a modifier that wraps the input of an aggregate function.
AggFilter is used as a modifier that wraps the input of an aggregate function.
AggregationsItem encapsulates the information for constructing an aggregate output column, including its ColumnID and the aggregate expression that produces its value.
Aggregations is a set of AggregationsItem expressions that specify the ColumnIDs and aggregation expression for output columns projected by a containing grouping operator (GroupBy, ScalarGroupBy, or DistinctOn).
AlterTableRelocate represents an `ALTER TABLE/INDEX .
No description provided by the author
AlterTableSplit represents an `ALTER TABLE/INDEX .
No description provided by the author
AlterTableUnsplit represents an `ALTER TABLE/INDEX .
AlterTableUnsplit represents an `ALTER TABLE/INDEX .
And is the boolean conjunction operator that evalutes to true only if both of its conditions evaluate to true.
No description provided by the author
No description provided by the author
AnyNotNullAgg returns any non-NULL value it receives, with no other guarantees.
Any is a SQL operator that applies a comparison to every row of an input subquery and returns true if any of the comparisons are true, else returns null if any of the comparisons are null, else returns false.
AnyScalar is the form of ANY which refers to an ANY operation on a tuple or array, as opposed to Any which operates on a subquery.
No description provided by the author
ArrayFlatten is an ARRAY(<subquery>) expression.
Array is an ARRAY literal of the form ARRAY[<expr1>, <expr2>, ..., <exprN>].
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CancelQueries represents a `CANCEL QUERIES` statement.
CancelSessions represents a `CANCEL SESSIONS` statement.
Case is a CASE statement of the form: CASE [ <Input> ] WHEN <condval1> THEN <expr1> [ WHEN <condval2> THEN <expr2> ] ..
Cast converts the input expression into an expression of the target type.
No description provided by the author
Collate is an expression of the form x COLLATE y Where x is a "string type" (meaning either a normal string or a collated string), and y is a locale.
ColPrivate contains the ColumnID of a synthesized projection or aggregation column, as well as a set of lazily-populated scalar properties that apply to the column.
ColumnAccess is a scalar expression that returns a column from the given input expression (which is assumed to be of type Tuple).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ConstAgg is used in the special case when the value of a column is known to be constant within a grouping set; it returns that value.
ConstNotNullAgg is used in the special case when the value of a column is known to be constant within a grouping set, except on some rows where it can have a NULL value; it returns the non-NULL constant value.
Const is a typed scalar constant value.
No description provided by the author
ControlJobs represents a `PAUSE/CANCEL/RESUME JOBS` statement.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CreateTable represents a CREATE TABLE statement.
No description provided by the author
No description provided by the author
No description provided by the author
CumeDist is the relative rank of the current row: (number of rows preceding or peer with current row) / (total rows).
No description provided by the author
No description provided by the author
DefaultJoinOrderLimit denotes the default limit on the number of joins to reorder.
Delete is an operator used to delete all rows that are selected by a relational input expression: DELETE FROM abc WHERE a>0 ORDER BY b LIMIT 10 .
DenseRank is like Rank, but without gaps.
No description provided by the author
No description provided by the author
DistinctOn filters out rows that are identical on the set of grouping columns; only the first row (according to an ordering) is kept for each set of possible values.
No description provided by the author
------------------------------------------------------------ Normalize Rule Names ------------------------------------------------------------.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ExceptAll is an operator used to perform a set difference between the Left and Right input relations.
Except is an operator used to perform a set difference between the Left and Right input relations.
Exists takes a relational query as its input, and evaluates to true if the query returns at least one row.
Explain returns information about the execution plan of the "input" expression.
No description provided by the author
Export represents an `EXPORT` statement.
No description provided by the author
No description provided by the author
No description provided by the author
FakeRel is a mock relational operator used for testing; its logical properties are pre-determined and stored in the private.
No description provided by the author
False is the boolean false value that is equivalent to the tree.DBoolFalse datum value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FiltersItem contains a filter condition that's evaluated to determine whether Select or Join rows should be filtered.
Filters is a set of FiltersItem expressions that specify a set of conjuncts that filter rows selected by a containing Select or Join operator.
FirstAgg is used only by DistinctOn; it returns the value on the first row according to an ordering; if the ordering is unspecified (or partially specified), it is an arbitrary ordering but it must be the same across all FirstAggs in a DistinctOn.
FirstValue returns Value evaluated at the first row in the row's frame.
FKChecksItem is a foreign key check query, to be run after the main query.
No description provided by the author
FKChecks is a list of foreign key check queries, to be run after the main query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Function invokes a builtin SQL function like CONCAT or NOW, passing the given arguments.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GroupBy computes aggregate functions over groups of input rows.
GroupingPrivate is shared between the grouping-related operators: GroupBy ScalarGroupBy, and DistinctOn.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IfErr is roughly a runtime try-catch operator.
No description provided by the author
IndexJoin represents an inner join between an input expression and a primary index.
No description provided by the author
Indirection is a subscripting expression of the form <expr>[<index>].
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InnerJoinApply has the same join semantics as InnerJoin.
InnerJoin creates a result set that combines columns from its left and right inputs, based upon its "on" join predicate.
No description provided by the author
Insert evaluates a relational input expression, and inserts values from it into a target table.
IntersectAll is an operator used to perform an intersection between the Left and Right input relations.
Intersect is an operator used to perform an intersection between the Left and Right input relations.
No description provided by the author
Enumeration of all manual rule names.
No description provided by the author
No description provided by the author
No description provided by the author
JoinPrivate is shared between the various join operators including apply variants, but excluding IndexJoin, LookupJoin, MergeJoin.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
KVOptionsItem is the key and value of an option (see tree.KVOption).
KVOptions is a set of KVOptionItems that specify arbitrary keys and values that are used as modifiers for various statements (see tree.KVOptions).
Lag returns Value evaluated at the row Offset rows before this one.
LastValue returns Value evaluated at the last row in the row's frame.
Lead returns Value evaluated at the row Offset rows after this one.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Limit returns a limited subset of the results in the input relation.
LookupJoin represents a join between an input expression and an index.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Max1Row enforces that its input must return at most one row.
No description provided by the author
MergeJoin represents a join that is executed using merge-join.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Not is the boolean negation operator that evaluates to true if its input evaluates to false.
No description provided by the author
No description provided by the author
No description provided by the author
NthValue returns Value evaluated at the nth row in the row's frame.
Ntile builds a histogram with the specified number of buckets and evaluates to which bucket the row falls in.
Null is the constant SQL null value that has "unknown value" semantics.
NumManualRules tracks the number of manually-defined rules.
No description provided by the author
NumRuleNames tracks the total count of rule names.
Offset filters out the first Offset rows of the input relation; used in conjunction with Limit.
OpaqueMutation is a variant of OpaqueRel for operators that cause a schema change and cannot be executed following a mutation in the same transaction.
OpaqueMutation is a variant of OpaqueRel for operators that can mutate data as part of the transaction.
OpaqueRel is an opaque relational operator which is planned outside of the optimizer.
No description provided by the author
Ordinality adds a column to each row in its input containing a unique, increasing number.
No description provided by the author
Or is the boolean disjunction operator that evaluates to true if either one of its conditions evaluates to true.
No description provided by the author
PercentRank is (rank - 1) / (total rows - 1).
No description provided by the author
No description provided by the author
No description provided by the author
ProjectionsItem encapsulates the information needed to synthesize an output column, including its ColumnID and the scalar expression that produces its value.
Projections is a set of ProjectionsItem expressions that specify the ColumnIDs and scalar expressions for the synthesized output columns projected by a containing Project operator.
Project modifies the set of columns returned by the input result set.
ProjectSet represents a relational operator which zips through a list of generators for every row of the input.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Enumeration of all manual rule names.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Range contains an And expression that constrains a single variable to a range.
Rank computes the position of a row relative to an ordering, with same-valued rows receiving the same value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
------------------------------------------------------------ Explore Rule Names ------------------------------------------------------------.
No description provided by the author
RowNumber computes the position of a row relative to an ordering, with same-valued rows having ties broken arbitrarily.
No description provided by the author
SaveTablesDatabase is the name of the database where tables created by the saveTableNode are stored.
ScalarGroupBy computes aggregate functions over the complete set of input rows.
ScalarList is a list expression that has scalar expression items of type opt.ScalarExpr.
Scan returns a result set containing every row in a table by scanning one of the table's indexes according to its ordering.
No description provided by the author
Select filters rows from its input result set, based on the boolean filter predicate expression.
No description provided by the author
No description provided by the author
SequenceSelect represents a read from a sequence as a data source.
No description provided by the author
SetPrivate contains fields used by the relational set operators: Union, Intersect, Except, UnionAll, IntersectAll and ExceptAll.
ShowTraceForSession returns the current session traces.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Enumeration of all manual rule names.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Enumeration of all manual rule names.
No description provided by the author
No description provided by the author
Sort enforces the ordering of rows returned by its input expression.
No description provided by the author
No description provided by the author
No description provided by the author
Subquery is a subquery in a single-row context.
SubqueryPrivate contains information related to a subquery (Subquery, Any, Exists).
No description provided by the author
No description provided by the author
True is the boolean true value that is equivalent to the tree.DBoolTrue datum value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnionAll is an operator used to combine the Left and Right input relations into a single set containing rows from both inputs.
Union is an operator used to combine the Left and Right input relations into a single set containing rows from both inputs.
No description provided by the author
UnsupportedExpr is used for interfacing with the old planner code.
Update evaluates a relational input expression that fetches existing rows from a target table and computes new values for one or more columns.
Upsert evaluates a relational input expression that tries to insert a new row into a target table.
Values returns a manufactured result set containing a constant number of rows.
No description provided by the author
Variable is the typed scalar value of a column in the query.
No description provided by the author
VirtualScan returns a result set containing every row in a virtual table.
No description provided by the author
When represents a single WHEN ..
WindowFromOffset is used as a modifier that wraps the input of a window function.
Window represents a window function.
No description provided by the author
WindowsItem is a single window function to be computed in the context of a Window expression.
No description provided by the author
Windows is a set of window functions to be computed in the context of a Window expression.
WindowToOffset is used as a modifier that wraps the input of a window function.
With executes Binding, making its results available to Main.
No description provided by the author
WithScan returns the results present in the With expression referenced by ID.
No description provided by the author
No description provided by the author
ZigzagJoin represents a join that is executed using the zigzag joiner.
No description provided by the author
ZipItem contains a generator function or scalar expression that is contained in a Zip.
ZipItemPrivate contains the list of output columns for the generator function or scalar expression in a ZipItem, as well as a set of lazily-populated scalar properties that apply to the ZipItem.
Zip represents a functional zip over generators a,b,c, which returns tuples of values from a,b,c picked "simultaneously".

# Variables

No description provided by the author
AggregateOpReverseMap maps from an optimizer operator type to the name of an aggregation function.
No description provided by the author
BinaryOpReverseMap maps from an optimizer operator type to a semantic tree binary operator type.
No description provided by the author
No description provided by the author
ComparisonOpMap maps from a semantic tree comparison operator type to an optimizer operator type.
ComparisonOpReverseMap maps from an optimizer operator type to a semantic tree comparison operator type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NegateOpMap maps from a comparison operator type to its negated operator type, as if the Not operator was applied to it.
OpTelemetryCounters stores telemetry counters for operators marked with the "Telemetry" tag.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnaryOpReverseMap maps from an optimizer operator type to a semantic tree unary operator type.
No description provided by the author
WindowOpReverseMap maps from an optimizer operator type to the name of a window function.

# Structs

AliasedColumn specifies the label and id of a column.
ColSet efficiently stores an unordered set of column ids.
ColumnMeta stores information about one of the columns stored in the metadata.
MDDepName stores either the unresolved DataSourceName or the StableID from the query that was used to resolve a data source.
Metadata assigns unique ids to the columns, tables, and other metadata used within the scope of a particular query.
TableMeta stores information about one of the tables stored in the metadata.
ViewDep contains information about a view dependency.

# Interfaces

Expr is a node in an expression tree.
MutableExpr is implemented by expressions that allow their children to be updated.
OpaqueMetadata is an object stored in OpaqueRelExpr and passed through to the exec factory.
ScalarExpr is a scalar expression, which is an expression that returns a primitive-typed value like boolean or string rather than rows and columns.

# Type aliases

ColList is a list of column ids.
ColMap provides a 1:1 mapping from one column id to another.
ColumnID uniquely identifies the usage of a column within the scope of a query.
Operator describes the type of operation that a memo expression performs.
Ordering defines the order of rows provided or required by an operator.
OrderingColumn is the ColumnID for a column that is part of an ordering, except that it can be negated to indicate a descending ordering on that column.
OrderingSet is a set of orderings, with the restriction that no ordering is a prefix of another ordering in the set.
RuleName enumerates the names of all the optimizer rules.
ScalarID is the type of the memo-unique identifier given to every scalar expression.
SchemaID uniquely identifies the usage of a schema within the scope of a query.
SequenceID uniquely identifies the usage of a sequence within the scope of a query.
TableAnnID uniquely identifies an annotation on an instance of table metadata.
TableID uniquely identifies the usage of a table within the scope of a query.
ValuesID uniquely identifies the usage of a values clause within the scope of a query.
ViewDeps contains information about the dependencies of a view.
WithID uniquely identifies a With expression within the scope of a query.