package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
AddAggInputColumns adds the set of columns the aggregate depands on to the given set.
AggregateOverloadExists returns whether or not the given operator has a unary overload which takes the given type as input.
BinaryAllowsNullArgs returns true if the given binary operator allows null arguments, and cannot therefore be folded away to null.
BinaryOverloadExists returns true if the given binary operator exists with the given arguments.
BuildConstraints returns a constraint.Set that represents the given scalar expression.
BuildSharedProps fills in the shared properties derived from the given expression's subtree.
CanAutoCommit determines if it is safe to auto commit the mutation contained in the expression.
CanBeCompositeSensitive returns true if a scalar expression could return logically different results because of non-logical differences in outer columns with composite type.
CanExtractConstDatum returns true if a constant datum can be created from the given expression (tuples and arrays of constant values are considered constant values).
CanExtractConstTuple returns true if the expression is a TupleOp with constant values (a nested tuple of constant values is considered constant).
CollectContiguousOrExprs finds all OrExprs in 'e' that are connected via a parent-child relationship, and returns them in an array of ScalarExprs.
DeriveJoinMultiplicityFromInputs returns a JoinMultiplicity that describes how an inner join with the given inputs and filters will affect the rows of its inputs.
ExprIsNeverNull makes a best-effort attempt to prove that the provided scalar is always non-NULL, given the set of outer columns that are known to be not null.
ExtractAggFirstVar is given an aggregate expression and returns the Variable expression for the first argument, skipping past modifiers like AggDistinct.
ExtractAggFunc digs down into the given aggregate expression and returns the aggregate function, skipping past any AggFilter or AggDistinct operators.
ExtractAggInputColumns returns the set of columns the aggregate depends on.
ExtractColumnFromProjectOrValues searches a Project or Values input expression for the column having the given id.
ExtractConstColumns returns columns in the filters expression that have been constrained to fixed values.
ExtractConstDatum returns the Datum that represents the value of an expression with a constant value.
ExtractJoinCondition returns true if the given condition is a simple equality or inequality condition with two variables (e.g.
ExtractJoinConditionFilterOrds returns the join conditions within on filters as a set of ordinals into the on filters.
ExtractJoinEquality restricts ExtractJoinCondition to only allow equalities.
ExtractJoinEqualityColumns returns pairs of columns (one from the left side, one from the right side) which are constrained to be equal in a join (and have equivalent types).
ExtractJoinEqualityColumnsWithFilterOrds returns pairs of columns (one from the left side, one from the right side) which are constrained to be equal in a join (and have equivalent types).
ExtractJoinEqualityFilters returns the filters containing pairs of columns (one from the left side, one from the right side) which are constrained to be equal in a join (and have equivalent types).
ExtractJoinEqualityLeftColumns returns the columns from leftCols which are constrained to be equal to columns in rightCols in a join (and have equivalent types).
ExtractJoinInequalityRightColumnsWithFilterOrds returns columns from rightCols which are constrained by an inequality in a join (and have equivalent types) with columns in leftCols.
ExtractRemainingJoinFilters calculates the remaining ON condition after removing equalities that are handled separately.
ExtractTailCalls traverses the given expression tree, searching for routines that are in tail-call position relative to the (assumed) calling routine.
ExtractValueForConstColumn returns the constant value of a column returned by ExtractConstColumns.
FindAggregateOverload finds an aggregate function overload that matches the given aggregate function expression.
FindBinaryOverload finds the correct type signature overload for the specified binary operator, given the types of its inputs.
FindComparisonOverload finds the correct type signature overload for the specified comparison operator, given the types of its inputs.
FindFunction returns the function properties and overload of the function with the given name and argument types matching the children of the given input.
FindInlinableConstants returns the set of input columns that are synthesized constant value expressions: ConstOp, TrueOp, FalseOp, or NullOp.
FindUnaryOverload finds the correct type signature overload for the specified unary operator, given the type of its input.
FindWindowOverload finds a window function overload that matches the given window function expression.
FormatExpr returns a string representation of the given expression, formatted according to the specified flags.
FormatPrivate outputs a description of the private to f.Buffer.
GetJoinMultiplicity returns a JoinMultiplicity struct that describes how a join operator will affect the rows of its left and right inputs (e.g.
HasJoinCondition returns true if the given on filters contain at least one join conditions between a column in leftCols and a column in rightCols.
InferBinaryType infers the return type of a binary expression, given the type of its inputs.
InferType derives the type of the given scalar expression.
InferUnaryType infers the return type of a unary operator, given the type of its input.
InferWhensType returns the type of a CASE expression, which is of the form:
CASE [ <cond> ] WHEN <condval1> THEN <expr1> [ WHEN <condval2> THEN <expr2> ] ..
LastGroupMember returns the last member in the same memo group of the given relational expression.
MakeExprFmtCtx creates an expression formatting context from a new buffer.
MakeExprFmtCtxBuffer creates an expression formatting context from an existing buffer.
MakeScanLimit initializes a ScanLimit with a number of rows and a direction.
MakeTableFuncDep returns the set of functional dependencies derived from the given base table.
NewColumnNameGenerator creates a new instance of ColumnNameGenerator, initialized with the given relational expression.
NewExprNameGenerator creates a new instance of ExprNameGenerator, initialized with the given prefix.
NormalizeComparison maps a given comparison operator into an equivalent operator that exists in the tree.CmpOps map, returning this new operator, along with "flipped" and "not" flags.
NullColsRejectedByFilter returns a set of columns that are "null rejected" by the filters.
OutputColumnIsAlwaysNull returns true if the expression produces only NULL values for the given column.
RequestColStat causes a column statistic to be calculated on the relational expression.
ValuesLegalForInsertFastPath tests if `values` is a Values expression that has no subqueries or UDFs and has less rows than the max number of entries in a KV batch for a mutation operation.
WithUses returns the WithUsesMap for the given expression.
# Constants
AllowAllJoinsIntoRight has all "disallow" flags set except DisallowHashJoinStoreRight, DisallowLookupJoinIntoRight, DisallowInvertedJoinIntoRight, and DisallowMergeJoin.
AllowOnlyHashJoinStoreRight has all "disallow" flags set except DisallowHashJoinStoreRight.
AllowOnlyInvertedJoinIntoRight has all "disallow" flags set except DisallowInvertedJoinIntoRight.
AllowOnlyLookupJoinIntoRight has all "disallow" flags set except DisallowLookupJoinIntoRight.
AllowOnlyMergeJoin has all "disallow" flags set except DisallowMergeJoin.
DisallowHashJoinStoreLeft corresponds to a hash join where the left side is stored into the hashtable.
DisallowHashJoinStoreRight corresponds to a hash join where the right side is stored into the hashtable.
DisallowInvertedJoinIntoLeft corresponds to an inverted join where the inverted index is on the left side.
DisallowInvertedJoinIntoRight corresponds to an inverted join where the inverted index is on the right side.
DisallowLookupJoinIntoLeft corresponds to a lookup join where the lookup table is on the left side.
DisallowLookupJoinIntoRight corresponds to a lookup join where the lookup table is on the right side.
DisallowMergeJoin corresponds to a merge join.
ExprFmtHideAll shows only the basic structure of the expression.
ExprFmtHideColumns removes column information.
ExprFmtHideConstraints does not show inferred constraints in the output.
ExprFmtHideCost does not show expression cost in the output.
ExprFmtHideFastPathChecks hides information about insert fast path unique check expressions.
ExprFmtHideFuncDeps does not show functional dependencies in the output.
ExprFmtHideHistograms does not show statistics histograms in the output.
ExprFmtHideMiscProps does not show outer columns, row cardinality, provided orderings, side effects, or error text in the output.
ExprFmtHideNotNull hides the !null specifier from columns.
ExprFmtHideNotVisibleIndexInfo hides information about invisible index.
ExprFmtHidePhysProps hides all required physical properties, except for Presentation (see ExprFmtHideColumns).
ExprFmtHideQualifications removes the qualification from column labels (except when a shortened name would be ambiguous).
ExprFmtHideRuleProps does not show rule-specific properties in the output.
ExprFmtHideScalars removes subtrees that contain only scalars and replaces them with the SQL expression (if possible).
ExprFmtHideStats does not show statistics in the output.
ExprFmtHideTypes hides type information from columns and scalar expressions.
ExprFmtShowAll shows all properties of the expression.
NoStreaming means that the grouping columns have no useful order, so a hash aggregator should be used.
PartialStreaming means that the grouping columns are partially ordered, so some optimizations can be done during aggregation.
PreferLookupJoinIntoLeft reduces the cost of a lookup join where the lookup table is on the left side.
PreferLookupJoinIntoRight reduces the cost of a lookup join where the lookup table is on the right side.
Streaming means that the grouping columns are fully ordered.
UnknownAvgRowSize is the average size of a row in bytes, which is used in the absence of any real statistics.
UnknownDistinctCountRatio is the ratio of distinct column values to number of rows, which is used in the absence of any real statistics for non-key columns.
UnknownNullCountRatio is the ratio of null column values to number of rows for nullable columns, which is used in the absence of any real statistics.
# Variables
CountRowsSingleton maintains a global instance of CountRowsExpr, to avoid allocations.
CumeDistSingleton is the global instance of CumeDistExpr.
DenseRankSingleton is the global instance of DenseRankExpr.
EmptyGroupingPrivate is a global instance of a GroupingPrivate that has no grouping columns and no ordering.
EmptyJoinPrivate is a global instance of a JoinPrivate that has no fields set.
EmptyTuple is a global instance of a TupleExpr that contains no elements.
FalseSingleton is a global instance of FalseExpr, to avoid allocations.
GetBuiltinProperties is set to builtinsregistry.GetBuiltinProperties in an init function in the norm package.
GetLookupJoinLookupTableDistribution returns the Distribution of a lookup table in a lookup join if that distribution can be statically determined.
MaxCost is the maximum possible estimated cost.
NullSingleton is a global instance of NullExpr having the Unknown type (most common case), to avoid allocations.
PercentRankSingleton is the global instance of PercentRankExpr.
RankSingleton is the global instance of RankExpr.
RowNumberSingleton is the global instance of RowNumber.
ScalarFmtInterceptor is a callback that can be set to a custom formatting function.
ScalarListWithEmptyTuple is a global instance of a ScalarListExpr containing a TupleExpr that contains no elements.
ScanIsReverseFn is a callback that is used to figure out if a scan needs to happen in reverse (the code lives in the ordering package, and depending on that directly would be a dependency loop).
TrueFilter is a global instance of the empty FiltersExpr, used in situations where the filter should always evaluate to true:
SELECT * FROM a INNER JOIN b ON True.
TrueSingleton is a global instance of TrueExpr, to avoid allocations.
# Structs
AfterTriggers stores metadata necessary for building a set of AFTER triggers.
ColumnNameGenerator is used to generate a unique name for each column of a relational expression.
Cost is the best-effort approximation of the actual cost of executing a particular operator tree.
CostFlags contains flags that penalize the cost of an operator.
ExceptionBlock contains the information needed to match and handle errors in the EXCEPTION block of a routine defined with PLpgSQL.
ExprFmtCtx is passed as context to expression formatting functions, which need to know the formatting flags and memo in order to format.
ExprNameGenerator is used to generate a unique name for each relational expression in a query tree.
FiltersExprMutateChecker is used to check if a FiltersExpr has been erroneously mutated.
FKCascade stores metadata necessary for building a cascading query.
Memo is a data structure for efficiently storing a forest of query plans.
ScanFlags stores any flags for the scan specified in the query (see tree.IndexFlags).
UDFDefinition stores details about the SQL body of a UDF.
WindowFrame denotes the definition of a window frame for an individual window function, excluding the OFFSET expressions, if present.
# Interfaces
PostQueryBuilder is an interface used to construct either a cascading query for a specific FK relation, or an AFTER trigger action.
RelExpr is implemented by all operators tagged as Relational.
ScalarPropsExpr is implemented by scalar expressions which cache scalar properties, like FiltersExpr and ProjectionsExpr.
ValuesContainer lets ValuesExpr and LiteralValuesExpr share code.
# Type aliases
ExprFmtFlags controls which properties of the expression are shown in formatted output.
FKCascades stores metadata necessary for building cascading queries.
GroupingOrderType is the grouping column order type for group by and distinct operations in the memo.
JoinFlags stores restrictions on the join execution method, derived from hints for a join specified in the query (see tree.JoinTableExpr).
replaceFunc is the callback function passed to norm.Factory.Replace.
ScanLimit is used for a limited table or index scan and stores the limit as well as the desired scan direction.
TupleOrdinal is an ordinal index into an expression of type Tuple.