Versions in this module Expand all Collapse all v1 v1.0.1 Jul 31, 2024 Changes in this version + const HashDistinctOp + const NoDistinctOp + const SortedDistinctOp + var ErrUnsupportedReorderNode = errors.New("unsupported join reorder node") + var HaltErr = errors.New("halt dfs") + func CardMemoGroups(g *ExprGroup) + func DescribeStats(r RelExpr) *sql.DescribeStats + func DfsRel(grp *ExprGroup, cb func(rel RelExpr) error) error + func FormatExpr(r exprType) string + func NewJoinOrderBuilder(memo *Memo) *joinOrderBuilder + func TableIdForSource(id GroupId) sql.TableId + type AntiJoin struct + func (r *AntiJoin) JoinPrivate() *JoinBase + func (r *AntiJoin) String() string + func (r AntiJoin) Cost() float64 + func (r AntiJoin) Distinct() distinctOp + func (r AntiJoin) Group() *ExprGroup + func (r AntiJoin) Next() RelExpr + func (r AntiJoin) SetCost(c float64) + func (r AntiJoin) SetDistinct(d distinctOp) + func (r AntiJoin) SetGroup(g *ExprGroup) + func (r AntiJoin) SetNext(rel RelExpr) + type ArithType uint8 + const ArithTypeBitAnd + const ArithTypeBitOr + const ArithTypeBitXor + const ArithTypeDiv + const ArithTypeIntDiv + const ArithTypeMinus + const ArithTypeMod + const ArithTypeMult + const ArithTypePlus + const ArithTypeShiftLeft + const ArithTypeShiftRight + const ArithTypeUnknown + func (i ArithType) String() string + type ConcatJoin struct + Concat []*IndexScan + func (r *ConcatJoin) JoinPrivate() *JoinBase + func (r *ConcatJoin) String() string + func (r ConcatJoin) Cost() float64 + func (r ConcatJoin) Distinct() distinctOp + func (r ConcatJoin) Group() *ExprGroup + func (r ConcatJoin) Next() RelExpr + func (r ConcatJoin) SetCost(c float64) + func (r ConcatJoin) SetDistinct(d distinctOp) + func (r ConcatJoin) SetGroup(g *ExprGroup) + func (r ConcatJoin) SetNext(rel RelExpr) + type Coster interface + EstimateCost func(*sql.Context, RelExpr, sql.StatsProvider) (float64, error) + func NewDefaultCoster() Coster + func NewHashBiasedCoster() Coster + func NewInnerBiasedCoster() Coster + func NewLookupBiasedCoster() Coster + func NewMergeBiasedCoster() Coster + func NewPartialBiasedCoster() Coster + func NewRangeHeapBiasedCoster() Coster + type CrossJoin struct + func (r *CrossJoin) JoinPrivate() *JoinBase + func (r *CrossJoin) String() string + func (r CrossJoin) Cost() float64 + func (r CrossJoin) Distinct() distinctOp + func (r CrossJoin) Group() *ExprGroup + func (r CrossJoin) Next() RelExpr + func (r CrossJoin) SetCost(c float64) + func (r CrossJoin) SetDistinct(d distinctOp) + func (r CrossJoin) SetGroup(g *ExprGroup) + func (r CrossJoin) SetNext(rel RelExpr) + type Distinct struct + Child *ExprGroup + func (r *Distinct) Children() []*ExprGroup + func (r *Distinct) String() string + func (r Distinct) Cost() float64 + func (r Distinct) Distinct() distinctOp + func (r Distinct) Group() *ExprGroup + func (r Distinct) Next() RelExpr + func (r Distinct) SetCost(c float64) + func (r Distinct) SetDistinct(d distinctOp) + func (r Distinct) SetGroup(g *ExprGroup) + func (r Distinct) SetNext(rel RelExpr) + type EmptyTable struct + Table *plan.EmptyTable + func (r *EmptyTable) Children() []*ExprGroup + func (r *EmptyTable) Name() string + func (r *EmptyTable) OutputCols() sql.Schema + func (r *EmptyTable) String() string + func (r *EmptyTable) TableId() sql.TableId + func (r *EmptyTable) TableIdNode() plan.TableIdNode + func (s EmptyTable) Indexes() []*Index + func (s EmptyTable) SetIndexes(indexes []*Index) + type ExecBuilder struct + func NewExecBuilder() *ExecBuilder + type ExprGroup struct + Best RelExpr + Cost float64 + Done bool + First RelExpr + HintOk bool + Id GroupId + RelProps *relProps + func (e *ExprGroup) Prepend(rel RelExpr) + func (e *ExprGroup) String() string + type Filter struct + Child *ExprGroup + Filters []sql.Expression + func (r *Filter) Children() []*ExprGroup + func (r *Filter) String() string + func (r Filter) Cost() float64 + func (r Filter) Distinct() distinctOp + func (r Filter) Group() *ExprGroup + func (r Filter) Next() RelExpr + func (r Filter) SetCost(c float64) + func (r Filter) SetDistinct(d distinctOp) + func (r Filter) SetGroup(g *ExprGroup) + func (r Filter) SetNext(rel RelExpr) + type FullOuterJoin struct + func (r *FullOuterJoin) JoinPrivate() *JoinBase + func (r *FullOuterJoin) String() string + func (r FullOuterJoin) Cost() float64 + func (r FullOuterJoin) Distinct() distinctOp + func (r FullOuterJoin) Group() *ExprGroup + func (r FullOuterJoin) Next() RelExpr + func (r FullOuterJoin) SetCost(c float64) + func (r FullOuterJoin) SetDistinct(d distinctOp) + func (r FullOuterJoin) SetGroup(g *ExprGroup) + func (r FullOuterJoin) SetNext(rel RelExpr) + type GroupId uint16 + type HashJoin struct + LeftAttrs []sql.Expression + RightAttrs []sql.Expression + func (r *HashJoin) JoinPrivate() *JoinBase + func (r *HashJoin) String() string + func (r HashJoin) Cost() float64 + func (r HashJoin) Distinct() distinctOp + func (r HashJoin) Group() *ExprGroup + func (r HashJoin) Next() RelExpr + func (r HashJoin) SetCost(c float64) + func (r HashJoin) SetDistinct(d distinctOp) + func (r HashJoin) SetGroup(g *ExprGroup) + func (r HashJoin) SetNext(rel RelExpr) + type Hint struct + Args []string + Typ HintType + func ExtractJoinHint(n *plan.JoinNode) []Hint + func (h Hint) String() string + type HintType uint8 + const HintTypeAntiJoin + const HintTypeHashJoin + const HintTypeInnerJoin + const HintTypeJoinFixedOrder + const HintTypeJoinOrder + const HintTypeLeftDeep + const HintTypeLeftOuterLookupJoin + const HintTypeLookupJoin + const HintTypeMergeJoin + const HintTypeNoIndexConditionPushDown + const HintTypeSemiJoin + const HintTypeUnknown + func (i HintType) String() string + type Index struct + func (i *Index) ColSet() sql.ColSet + func (i *Index) Cols() []sql.ColumnId + func (i *Index) SqlIdx() sql.Index + type IndexScan struct + Alias string + Index *Index + Stats sql.Statistic + Table *plan.IndexedTableAccess + func (r *IndexScan) Children() []*ExprGroup + func (r *IndexScan) Name() string + func (r *IndexScan) OutputCols() sql.Schema + func (r *IndexScan) String() string + func (r *IndexScan) TableId() sql.TableId + func (r *IndexScan) TableIdNode() plan.TableIdNode + func (s IndexScan) Indexes() []*Index + func (s IndexScan) SetIndexes(indexes []*Index) + type InnerJoin struct + func (r *InnerJoin) JoinPrivate() *JoinBase + func (r *InnerJoin) String() string + func (r InnerJoin) Cost() float64 + func (r InnerJoin) Distinct() distinctOp + func (r InnerJoin) Group() *ExprGroup + func (r InnerJoin) Next() RelExpr + func (r InnerJoin) SetCost(c float64) + func (r InnerJoin) SetDistinct(d distinctOp) + func (r InnerJoin) SetGroup(g *ExprGroup) + func (r InnerJoin) SetNext(rel RelExpr) + type JSONTable struct + Table *plan.JSONTable + func (r *JSONTable) Children() []*ExprGroup + func (r *JSONTable) Name() string + func (r *JSONTable) OutputCols() sql.Schema + func (r *JSONTable) String() string + func (r *JSONTable) TableId() sql.TableId + func (r *JSONTable) TableIdNode() plan.TableIdNode + func (s JSONTable) Indexes() []*Index + func (s JSONTable) SetIndexes(indexes []*Index) + type JoinBase struct + Filter []sql.Expression + Left *ExprGroup + Op plan.JoinType + Right *ExprGroup + func (r *JoinBase) Children() []*ExprGroup + func (r *JoinBase) Copy() *JoinBase + func (r *JoinBase) JoinPrivate() *JoinBase + func (r JoinBase) Cost() float64 + func (r JoinBase) Distinct() distinctOp + func (r JoinBase) Group() *ExprGroup + func (r JoinBase) Next() RelExpr + func (r JoinBase) SetCost(c float64) + func (r JoinBase) SetDistinct(d distinctOp) + func (r JoinBase) SetGroup(g *ExprGroup) + func (r JoinBase) SetNext(rel RelExpr) + type JoinRel interface + Group func() *ExprGroup + JoinPrivate func() *JoinBase + type LateralJoin struct + func (r *LateralJoin) JoinPrivate() *JoinBase + func (r *LateralJoin) String() string + func (r LateralJoin) Cost() float64 + func (r LateralJoin) Distinct() distinctOp + func (r LateralJoin) Group() *ExprGroup + func (r LateralJoin) Next() RelExpr + func (r LateralJoin) SetCost(c float64) + func (r LateralJoin) SetDistinct(d distinctOp) + func (r LateralJoin) SetGroup(g *ExprGroup) + func (r LateralJoin) SetNext(rel RelExpr) + type LeftJoin struct + func (r *LeftJoin) JoinPrivate() *JoinBase + func (r *LeftJoin) String() string + func (r LeftJoin) Cost() float64 + func (r LeftJoin) Distinct() distinctOp + func (r LeftJoin) Group() *ExprGroup + func (r LeftJoin) Next() RelExpr + func (r LeftJoin) SetCost(c float64) + func (r LeftJoin) SetDistinct(d distinctOp) + func (r LeftJoin) SetGroup(g *ExprGroup) + func (r LeftJoin) SetNext(rel RelExpr) + type LookupJoin struct + Injective bool + Lookup *IndexScan + func (r *LookupJoin) Children() []*ExprGroup + func (r *LookupJoin) JoinPrivate() *JoinBase + func (r *LookupJoin) String() string + func (r LookupJoin) Cost() float64 + func (r LookupJoin) Distinct() distinctOp + func (r LookupJoin) Group() *ExprGroup + func (r LookupJoin) Next() RelExpr + func (r LookupJoin) SetCost(c float64) + func (r LookupJoin) SetDistinct(d distinctOp) + func (r LookupJoin) SetGroup(g *ExprGroup) + func (r LookupJoin) SetNext(rel RelExpr) + type Max1Row struct + Child *ExprGroup + func (r *Max1Row) Children() []*ExprGroup + func (r *Max1Row) String() string + func (r Max1Row) Cost() float64 + func (r Max1Row) Distinct() distinctOp + func (r Max1Row) Group() *ExprGroup + func (r Max1Row) Next() RelExpr + func (r Max1Row) SetCost(c float64) + func (r Max1Row) SetDistinct(d distinctOp) + func (r Max1Row) SetGroup(g *ExprGroup) + func (r Max1Row) SetNext(rel RelExpr) + type Memo struct + Ctx *sql.Context + TableProps *tableProps + func NewMemo(ctx *sql.Context, stats sql.StatsProvider, s *plan.Scope, scopeLen int, ...) *Memo + func (m *Memo) ApplyHint(hint Hint) + func (m *Memo) BestRootPlan(ctx *sql.Context) (sql.Node, error) + func (m *Memo) HandleErr(err error) + func (m *Memo) MemoizeConcatLookupJoin(grp, left, right *ExprGroup, op plan.JoinType, filter []sql.Expression, ...) *ExprGroup + func (m *Memo) MemoizeFilter(grp, child *ExprGroup, filters []sql.Expression) *ExprGroup + func (m *Memo) MemoizeHashJoin(grp *ExprGroup, join *JoinBase, toExpr, fromExpr []sql.Expression) *ExprGroup + func (m *Memo) MemoizeIndexScan(grp *ExprGroup, ita *plan.IndexedTableAccess, alias string, index *Index, ...) *ExprGroup + func (m *Memo) MemoizeInnerJoin(grp, left, right *ExprGroup, op plan.JoinType, filter []sql.Expression) *ExprGroup + func (m *Memo) MemoizeLeftJoin(grp, left, right *ExprGroup, op plan.JoinType, filter []sql.Expression) *ExprGroup + func (m *Memo) MemoizeLookupJoin(grp, left, right *ExprGroup, op plan.JoinType, filter []sql.Expression, ...) *ExprGroup + func (m *Memo) MemoizeMax1Row(grp, child *ExprGroup) *ExprGroup + func (m *Memo) MemoizeMergeJoin(grp, left, right *ExprGroup, lIdx, rIdx *IndexScan, op plan.JoinType, ...) *ExprGroup + func (m *Memo) MemoizeProject(grp, child *ExprGroup, projections []sql.Expression) *ExprGroup + func (m *Memo) MemoizeRangeHeapJoin(grp, left, right *ExprGroup, op plan.JoinType, filter []sql.Expression, ...) *ExprGroup + func (m *Memo) NewExprGroup(rel exprType) *ExprGroup + func (m *Memo) OptimizeRoot() error + func (m *Memo) Root() *ExprGroup + func (m *Memo) StatsProvider() sql.StatsProvider + func (m *Memo) String() string + func (m *Memo) WithJoinOp(op HintType, left, right string) + func (m *Memo) WithJoinOrder(tables []string) + type MemoErr struct + Err error + type MergeJoin struct + CmpCnt int + Injective bool + InnerScan *IndexScan + OuterScan *IndexScan + SwapCmp bool + func (r *MergeJoin) JoinPrivate() *JoinBase + func (r *MergeJoin) String() string + func (r MergeJoin) Cost() float64 + func (r MergeJoin) Distinct() distinctOp + func (r MergeJoin) Group() *ExprGroup + func (r MergeJoin) Next() RelExpr + func (r MergeJoin) SetCost(c float64) + func (r MergeJoin) SetDistinct(d distinctOp) + func (r MergeJoin) SetGroup(g *ExprGroup) + func (r MergeJoin) SetNext(rel RelExpr) + type Project struct + Child *ExprGroup + Projections []sql.Expression + func (r *Project) Children() []*ExprGroup + func (r *Project) String() string + func (r Project) Cost() float64 + func (r Project) Distinct() distinctOp + func (r Project) Group() *ExprGroup + func (r Project) Next() RelExpr + func (r Project) SetCost(c float64) + func (r Project) SetDistinct(d distinctOp) + func (r Project) SetGroup(g *ExprGroup) + func (r Project) SetNext(rel RelExpr) + type RangeHeap struct + MaxColRef *expression.GetField + MinColRef *expression.GetField + MinExpr sql.Expression + MinIndex *IndexScan + Parent *JoinBase + RangeClosedOnLowerBound bool + RangeClosedOnUpperBound bool + ValueCol *expression.GetField + ValueExpr sql.Expression + ValueIndex *IndexScan + type RangeHeapJoin struct + RangeHeap *RangeHeap + func (r *RangeHeapJoin) JoinPrivate() *JoinBase + func (r *RangeHeapJoin) String() string + func (r RangeHeapJoin) Cost() float64 + func (r RangeHeapJoin) Distinct() distinctOp + func (r RangeHeapJoin) Group() *ExprGroup + func (r RangeHeapJoin) Next() RelExpr + func (r RangeHeapJoin) SetCost(c float64) + func (r RangeHeapJoin) SetDistinct(d distinctOp) + func (r RangeHeapJoin) SetGroup(g *ExprGroup) + func (r RangeHeapJoin) SetNext(rel RelExpr) + type RecursiveCte struct + Table *plan.RecursiveCte + func (r *RecursiveCte) Children() []*ExprGroup + func (r *RecursiveCte) Name() string + func (r *RecursiveCte) OutputCols() sql.Schema + func (r *RecursiveCte) String() string + func (r *RecursiveCte) TableId() sql.TableId + func (r *RecursiveCte) TableIdNode() plan.TableIdNode + func (s RecursiveCte) Indexes() []*Index + func (s RecursiveCte) SetIndexes(indexes []*Index) + type RecursiveTable struct + Table *plan.RecursiveTable + func (r *RecursiveTable) Children() []*ExprGroup + func (r *RecursiveTable) Name() string + func (r *RecursiveTable) OutputCols() sql.Schema + func (r *RecursiveTable) String() string + func (r *RecursiveTable) TableId() sql.TableId + func (r *RecursiveTable) TableIdNode() plan.TableIdNode + func (s RecursiveTable) Indexes() []*Index + func (s RecursiveTable) SetIndexes(indexes []*Index) + type RelExpr interface + Cost func() float64 + Distinct func() distinctOp + Next func() RelExpr + SetCost func(c float64) + SetDistinct func(distinctOp) + SetNext func(RelExpr) + type SemiJoin struct + func (r *SemiJoin) JoinPrivate() *JoinBase + func (r *SemiJoin) String() string + func (r SemiJoin) Cost() float64 + func (r SemiJoin) Distinct() distinctOp + func (r SemiJoin) Group() *ExprGroup + func (r SemiJoin) Next() RelExpr + func (r SemiJoin) SetCost(c float64) + func (r SemiJoin) SetDistinct(d distinctOp) + func (r SemiJoin) SetGroup(g *ExprGroup) + func (r SemiJoin) SetNext(rel RelExpr) + type SetOp struct + Table *plan.SetOp + func (r *SetOp) Children() []*ExprGroup + func (r *SetOp) Name() string + func (r *SetOp) OutputCols() sql.Schema + func (r *SetOp) String() string + func (r *SetOp) TableId() sql.TableId + func (r *SetOp) TableIdNode() plan.TableIdNode + func (s SetOp) Indexes() []*Index + func (s SetOp) SetIndexes(indexes []*Index) + type SourceRel interface + Indexes func() []*Index + Name func() string + OutputCols func() sql.Schema + SetIndexes func(indexes []*Index) + TableId func() sql.TableId + TableIdNode func() plan.TableIdNode + type SubqueryAlias struct + Table *plan.SubqueryAlias + func (r *SubqueryAlias) Children() []*ExprGroup + func (r *SubqueryAlias) Name() string + func (r *SubqueryAlias) OutputCols() sql.Schema + func (r *SubqueryAlias) String() string + func (r *SubqueryAlias) TableId() sql.TableId + func (r *SubqueryAlias) TableIdNode() plan.TableIdNode + func (s SubqueryAlias) Indexes() []*Index + func (s SubqueryAlias) SetIndexes(indexes []*Index) + type TableAlias struct + Table *plan.TableAlias + func (r *TableAlias) Children() []*ExprGroup + func (r *TableAlias) Name() string + func (r *TableAlias) OutputCols() sql.Schema + func (r *TableAlias) String() string + func (r *TableAlias) TableId() sql.TableId + func (r *TableAlias) TableIdNode() plan.TableIdNode + func (s TableAlias) Indexes() []*Index + func (s TableAlias) SetIndexes(indexes []*Index) + type TableAndColumn struct + type TableFunc struct + Table sql.TableFunction + func (r *TableFunc) Children() []*ExprGroup + func (r *TableFunc) Name() string + func (r *TableFunc) OutputCols() sql.Schema + func (r *TableFunc) String() string + func (r *TableFunc) TableId() sql.TableId + func (r *TableFunc) TableIdNode() plan.TableIdNode + func (s TableFunc) Indexes() []*Index + func (s TableFunc) SetIndexes(indexes []*Index) + type TableId uint16 + type TableScan struct + Table plan.TableIdNode + func (r *TableScan) Children() []*ExprGroup + func (r *TableScan) Name() string + func (r *TableScan) OutputCols() sql.Schema + func (r *TableScan) String() string + func (r *TableScan) TableId() sql.TableId + func (r *TableScan) TableIdNode() plan.TableIdNode + func (s TableScan) Indexes() []*Index + func (s TableScan) SetIndexes(indexes []*Index) + type Values struct + Table *plan.ValueDerivedTable + func (r *Values) Children() []*ExprGroup + func (r *Values) Name() string + func (r *Values) OutputCols() sql.Schema + func (r *Values) String() string + func (r *Values) TableId() sql.TableId + func (r *Values) TableIdNode() plan.TableIdNode + func (s Values) Indexes() []*Index + func (s Values) SetIndexes(indexes []*Index)