package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev

# Functions

GetEnforcerRules gets all candidate enforcer rules based on required physical property.
NewOptimizer returns a cascades optimizer with default transformation rules and implementation rules.
NewRuleEliminateOuterJoinBelowAggregation creates a new Transformation EliminateOuterJoinBelowAggregation.
NewRuleEliminateOuterJoinBelowProjection creates a new Transformation EliminateOuterJoinBelowProjection.
NewRuleEliminateProjection creates a new Transformation EliminateProjection.
NewRuleEliminateSingleMaxMin creates a new Transformation EliminateSingleMaxMin.
NewRuleEnumeratePaths creates a new Transformation EnumeratePaths.
NewRuleInjectProjectionBelowAgg creates a new Transformation NewRuleInjectProjectionBelowAgg.
NewRuleInjectProjectionBelowTopN creates a new Transformation InjectProjectionBelowTopN.
NewRuleMergeAdjacentLimit creates a new Transformation MergeAdjacentLimit.
NewRuleMergeAdjacentProjection creates a new Transformation MergeAdjacentProjection.
NewRuleMergeAdjacentSelection creates a new Transformation MergeAdjacentSelection.
NewRuleMergeAdjacentTopN creates a new Transformation MergeAdjacentTopN.
NewRuleMergeAdjacentWindow creates a new Transformation MergeAdjacentWindow.
NewRuleMergeAggregationProjection creates a new Transformation MergeAggregationProjection.
NewRulePullSelectionUpApply creates a new Transformation PullSelectionUpApply.
NewRulePushAggDownGather creates a new Transformation PushAggDownGather.
NewRulePushLimitDownOuterJoin creates a new Transformation PushLimitDownOuterJoin.
NewRulePushLimitDownProjection creates a new Transformation.
NewRulePushLimitDownTiKVSingleGather creates a new Transformation PushLimitDownTiKVSingleGather.
NewRulePushLimitDownUnionAll creates a new Transformation PushLimitDownUnionAll.
NewRulePushSelDownAggregation creates a new Transformation PushSelDownAggregation.
NewRulePushSelDownIndexScan creates a new Transformation PushSelDownIndexScan.
NewRulePushSelDownJoin creates a new Transformation PushSelDownJoin.
NewRulePushSelDownProjection creates a new Transformation PushSelDownProjection.
NewRulePushSelDownSort creates a new Transformation PushSelDownSort.
NewRulePushSelDownTableScan creates a new Transformation PushSelDownTableScan.
NewRulePushSelDownTiKVSingleGather creates a new Transformation PushSelDownTiKVSingleGather.
NewRulePushSelDownUnionAll creates a new Transformation PushSelDownUnionAll.
NewRulePushSelDownWindow creates a new Transformation PushSelDownWindow.
NewRulePushTopNDownOuterJoin creates a new Transformation PushTopNDownOuterJoin.
NewRulePushTopNDownProjection creates a new Transformation PushTopNDownProjection.
NewRulePushTopNDownTiKVSingleGather creates a new Transformation PushTopNDownTiKVSingleGather.
NewRulePushTopNDownUnionAll creates a new Transformation PushTopNDownUnionAll.
NewRuleTransformAggregateCaseToSelection creates a new Transformation TransformAggregateCaseToSelection.
NewRuleTransformAggToProj creates a new Transformation TransformAggToProj.
NewRuleTransformApplyToJoin creates a new Transformation TransformApplyToJoin.
NewRuleTransformJoinCondToSel creates a new Transformation TransformJoinCondToSel.
NewRuleTransformLimitToTableDual creates a new Transformation TransformLimitToTableDual.
NewRuleTransformLimitToTopN creates a new Transformation TransformLimitToTopN.
ToString stringifies a Group Tree.

# Variables

DefaultOptimizer is the optimizer which contains all of the default transformation and implementation rules.
DefaultRuleBatches contain all the transformation rules.
PostTransformationBatch does the transformation which is related to the constraints of the execution engine of TiDB.
TiDBLayerOptimizationBatch does the optimization in the TiDB layer.
TiKVLayerOptimizationBatch does the optimization related to TiKV layer.

# Structs

EliminateOuterJoinBelowAggregation eliminate the outer join which below aggregation.
EliminateOuterJoinBelowProjection eliminate the outer join which below projection.
EliminateProjection eliminates the projection.
EliminateSingleMaxMin tries to convert a single max/min to Limit+Sort operators.
EnumeratePaths converts DataSource to table scan and index scans.
ImplApply implements LogicalApply to PhysicalApply.
ImplHashAgg is the implementation rule which implements LogicalAggregation to PhysicalHashAgg.
ImplHashJoinBuildLeft implements LogicalJoin to PhysicalHashJoin which uses the left child to build hash table.
ImplHashJoinBuildRight implements LogicalJoin to PhysicalHashJoin which uses the right child to build hash table.
ImplIndexScan implements IndexScan as PhysicalIndexScan.
ImplLimit is the implementation rule which implements LogicalLimit to PhysicalLimit.
ImplMaxOneRow implements LogicalMaxOneRow to PhysicalMaxOneRow.
ImplMemTableScan implements LogicalMemTable as PhysicalMemTable.
ImplMergeJoin implements LogicalMergeJoin to PhysicalMergeJoin.
ImplProjection implements LogicalProjection as PhysicalProjection.
ImplSelection is the implementation rule which implements LogicalSelection to PhysicalSelection.
ImplShow is the implementation rule which implements LogicalShow to PhysicalShow.
ImplSort is the implementation rule which implements LogicalSort to PhysicalSort or NominalSort.
ImplTableDual implements LogicalTableDual as PhysicalTableDual.
ImplTableScan implements TableScan as PhysicalTableScan.
ImplTiKVSingleReadGather implements TiKVSingleGather as PhysicalTableReader or PhysicalIndexReader.
ImplTopN is the implementation rule which implements LogicalTopN to PhysicalTopN.
ImplTopNAsLimit is the implementation rule which implements LogicalTopN as PhysicalLimit with required order property.
ImplUnionAll implements LogicalUnionAll to PhysicalUnionAll.
ImplWindow implements LogicalWindow to PhysicalWindow.
InjectProjectionBelowAgg injects Projection below Agg if Agg's AggFuncDesc.Args or Agg's GroupByItem contain ScalarFunctions.
InjectProjectionBelowTopN injects two Projections below and upon TopN if TopN's ByItems contain ScalarFunctions.
MergeAdjacentLimit merge the adjacent limit.
MergeAdjacentProjection merge the adjacent projection.
MergeAdjacentSelection merge adjacent selection.
MergeAdjacentTopN merge adjacent TopN.
MergeAdjacentWindow merge adjacent Window.
MergeAggregationProjection merges the Projection below an Aggregation as a new Aggregation.
Optimizer is the struct for cascades optimizer.
OrderEnforcer enforces order property on child implementation.
PullSelectionUpApply pulls up the inner-side Selection into Apply as its join condition.
PushAggDownGather splits Aggregation to two stages, final and partial1, and pushed the partial Aggregation down to the child of TiKVSingleGather.
PushLimitDownOuterJoin pushes Limit through Join.
PushLimitDownProjection pushes Limit to Projection.
PushLimitDownTiKVSingleGather pushes the limit down to child of TiKVSingleGather.
PushLimitDownUnionAll pushes limit to union all.
PushSelDownAggregation pushes Selection down to the child of Aggregation.
PushSelDownIndexScan pushes a Selection down to IndexScan.
PushSelDownJoin pushes Selection through Join.
PushSelDownProjection pushes the Selection down to the child of Projection.
PushSelDownSort pushes the Selection down to the child of Sort.
PushSelDownTableScan pushes the selection down to TableScan.
PushSelDownTiKVSingleGather pushes the selection down to child of TiKVSingleGather.
PushSelDownUnionAll pushes selection through union all.
PushSelDownWindow pushes Selection down to the child of Window.
PushTopNDownOuterJoin pushes topN to outer join.
PushTopNDownProjection pushes TopN to Projection.
PushTopNDownTiKVSingleGather pushes the top-n down to child of TiKVSingleGather.
PushTopNDownUnionAll pushes topN to union all.
TransformAggregateCaseToSelection convert Agg(case when) to Agg->Selection.
TransformAggToProj convert Agg to Proj.
TransformApplyToJoin transforms a LogicalApply to LogicalJoin if it's inner children has no correlated columns from it's outer schema.
TransformJoinCondToSel convert Join(len(cond) > 0) to Join-->(Sel, Sel).
TransformLimitToTableDual convert limit to TableDual.
TransformLimitToTopN transforms Limit+Sort to TopN.

# Interfaces

Enforcer defines the interface for enforcer rules.
ImplementationRule defines the interface for implementation rules.
Transformation defines the interface for the transformation rules.

# Type aliases

TransformationRuleBatch is a batch of transformation rules.