Documentation ¶
Index ¶
- Constants
- Variables
- func InferType(sc *variable.StatementContext, node ast.Node) error
- func InsertPlan(parent Plan, child Plan, insert Plan) error
- func RemovePlan(p Plan) error
- func ToString(p Plan) string
- func Validate(node ast.Node, inPrepare bool) error
- type AggregateFuncExtractor
- type Aggregation
- type AggregationType
- type Apply
- type ApplyConditionChecker
- type ByItems
- type Cache
- func (p *Cache) AddChild(child Plan)
- func (p *Cache) AddParent(parent Plan)
- func (p *Cache) Copy() PhysicalPlan
- func (p *Cache) GetChildByIndex(index int) (parent Plan)
- func (p *Cache) GetChildren() []Plan
- func (p *Cache) GetID() string
- func (p *Cache) GetParentByIndex(index int) (parent Plan)
- func (p *Cache) GetParents() []Plan
- func (p *Cache) GetSchema() expression.Schema
- func (p *Cache) IsCorrelated() bool
- func (p *Cache) MarshalJSON() ([]byte, error)
- func (p *Cache) ReplaceChild(child, newChild Plan) error
- func (p *Cache) ReplaceParent(parent, newPar Plan) error
- func (p *Cache) SetChildren(children ...Plan)
- func (p *Cache) SetCorrelated()
- func (p *Cache) SetParents(pars ...Plan)
- func (p *Cache) SetSchema(schema expression.Schema)
- type CheckTable
- func (p *CheckTable) AddChild(child Plan)
- func (p *CheckTable) AddParent(parent Plan)
- func (p *CheckTable) GetChildByIndex(index int) (parent Plan)
- func (p *CheckTable) GetChildren() []Plan
- func (p *CheckTable) GetID() string
- func (p *CheckTable) GetParentByIndex(index int) (parent Plan)
- func (p *CheckTable) GetParents() []Plan
- func (p *CheckTable) GetSchema() expression.Schema
- func (p *CheckTable) IsCorrelated() bool
- func (p *CheckTable) MarshalJSON() ([]byte, error)
- func (p *CheckTable) ReplaceChild(child, newChild Plan) error
- func (p *CheckTable) ReplaceParent(parent, newPar Plan) error
- func (p *CheckTable) SetChildren(children ...Plan)
- func (p *CheckTable) SetCorrelated()
- func (p *CheckTable) SetParents(pars ...Plan)
- func (p *CheckTable) SetSchema(schema expression.Schema)
- type DDL
- func (p *DDL) AddChild(child Plan)
- func (p *DDL) AddParent(parent Plan)
- func (p *DDL) GetChildByIndex(index int) (parent Plan)
- func (p *DDL) GetChildren() []Plan
- func (p *DDL) GetID() string
- func (p *DDL) GetParentByIndex(index int) (parent Plan)
- func (p *DDL) GetParents() []Plan
- func (p *DDL) GetSchema() expression.Schema
- func (p *DDL) IsCorrelated() bool
- func (p *DDL) MarshalJSON() ([]byte, error)
- func (p *DDL) ReplaceChild(child, newChild Plan) error
- func (p *DDL) ReplaceParent(parent, newPar Plan) error
- func (p *DDL) SetChildren(children ...Plan)
- func (p *DDL) SetCorrelated()
- func (p *DDL) SetParents(pars ...Plan)
- func (p *DDL) SetSchema(schema expression.Schema)
- type DataSource
- type Deallocate
- func (p *Deallocate) AddChild(child Plan)
- func (p *Deallocate) AddParent(parent Plan)
- func (p *Deallocate) GetChildByIndex(index int) (parent Plan)
- func (p *Deallocate) GetChildren() []Plan
- func (p *Deallocate) GetID() string
- func (p *Deallocate) GetParentByIndex(index int) (parent Plan)
- func (p *Deallocate) GetParents() []Plan
- func (p *Deallocate) GetSchema() expression.Schema
- func (p *Deallocate) IsCorrelated() bool
- func (p *Deallocate) MarshalJSON() ([]byte, error)
- func (p *Deallocate) ReplaceChild(child, newChild Plan) error
- func (p *Deallocate) ReplaceParent(parent, newPar Plan) error
- func (p *Deallocate) SetChildren(children ...Plan)
- func (p *Deallocate) SetCorrelated()
- func (p *Deallocate) SetParents(pars ...Plan)
- func (p *Deallocate) SetSchema(schema expression.Schema)
- type Delete
- type Execute
- func (p *Execute) AddChild(child Plan)
- func (p *Execute) AddParent(parent Plan)
- func (p *Execute) GetChildByIndex(index int) (parent Plan)
- func (p *Execute) GetChildren() []Plan
- func (p *Execute) GetID() string
- func (p *Execute) GetParentByIndex(index int) (parent Plan)
- func (p *Execute) GetParents() []Plan
- func (p *Execute) GetSchema() expression.Schema
- func (p *Execute) IsCorrelated() bool
- func (p *Execute) MarshalJSON() ([]byte, error)
- func (p *Execute) ReplaceChild(child, newChild Plan) error
- func (p *Execute) ReplaceParent(parent, newPar Plan) error
- func (p *Execute) SetChildren(children ...Plan)
- func (p *Execute) SetCorrelated()
- func (p *Execute) SetParents(pars ...Plan)
- func (p *Execute) SetSchema(schema expression.Schema)
- type Exists
- type Explain
- func (p *Explain) AddChild(child Plan)
- func (p *Explain) AddParent(parent Plan)
- func (p *Explain) GetChildByIndex(index int) (parent Plan)
- func (p *Explain) GetChildren() []Plan
- func (p *Explain) GetID() string
- func (p *Explain) GetParentByIndex(index int) (parent Plan)
- func (p *Explain) GetParents() []Plan
- func (p *Explain) GetSchema() expression.Schema
- func (p *Explain) IsCorrelated() bool
- func (p *Explain) MarshalJSON() ([]byte, error)
- func (p *Explain) ReplaceChild(child, newChild Plan) error
- func (p *Explain) ReplaceParent(parent, newPar Plan) error
- func (p *Explain) SetChildren(children ...Plan)
- func (p *Explain) SetCorrelated()
- func (p *Explain) SetParents(pars ...Plan)
- func (p *Explain) SetSchema(schema expression.Schema)
- type IndexRange
- type Insert
- type Join
- type JoinType
- type Limit
- func (p *Limit) Copy() PhysicalPlan
- func (p *Limit) MarshalJSON() ([]byte, error)
- func (p *Limit) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *Limit) PruneColumns(parentUsedCols []*expression.Column)
- func (p *Limit) ResolveIndicesAndCorCols()
- type LoadData
- func (p *LoadData) AddChild(child Plan)
- func (p *LoadData) AddParent(parent Plan)
- func (p *LoadData) GetChildByIndex(index int) (parent Plan)
- func (p *LoadData) GetChildren() []Plan
- func (p *LoadData) GetID() string
- func (p *LoadData) GetParentByIndex(index int) (parent Plan)
- func (p *LoadData) GetParents() []Plan
- func (p *LoadData) GetSchema() expression.Schema
- func (p *LoadData) IsCorrelated() bool
- func (p *LoadData) MarshalJSON() ([]byte, error)
- func (p *LoadData) ReplaceChild(child, newChild Plan) error
- func (p *LoadData) ReplaceParent(parent, newPar Plan) error
- func (p *LoadData) SetChildren(children ...Plan)
- func (p *LoadData) SetCorrelated()
- func (p *LoadData) SetParents(pars ...Plan)
- func (p *LoadData) SetSchema(schema expression.Schema)
- type LogicalPlan
- type MaxOneRow
- type PhysicalAggregation
- func (p *PhysicalAggregation) AddChild(child Plan)
- func (p *PhysicalAggregation) AddParent(parent Plan)
- func (p *PhysicalAggregation) Copy() PhysicalPlan
- func (p *PhysicalAggregation) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalAggregation) GetChildren() []Plan
- func (p *PhysicalAggregation) GetID() string
- func (p *PhysicalAggregation) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalAggregation) GetParents() []Plan
- func (p *PhysicalAggregation) GetSchema() expression.Schema
- func (p *PhysicalAggregation) IsCorrelated() bool
- func (p *PhysicalAggregation) MarshalJSON() ([]byte, error)
- func (p *PhysicalAggregation) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalAggregation) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalAggregation) SetChildren(children ...Plan)
- func (p *PhysicalAggregation) SetCorrelated()
- func (p *PhysicalAggregation) SetParents(pars ...Plan)
- func (p *PhysicalAggregation) SetSchema(schema expression.Schema)
- type PhysicalApply
- func (p *PhysicalApply) AddChild(child Plan)
- func (p *PhysicalApply) AddParent(parent Plan)
- func (p *PhysicalApply) Copy() PhysicalPlan
- func (p *PhysicalApply) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalApply) GetChildren() []Plan
- func (p *PhysicalApply) GetID() string
- func (p *PhysicalApply) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalApply) GetParents() []Plan
- func (p *PhysicalApply) GetSchema() expression.Schema
- func (p *PhysicalApply) IsCorrelated() bool
- func (p *PhysicalApply) MarshalJSON() ([]byte, error)
- func (p *PhysicalApply) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalApply) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalApply) SetChildren(children ...Plan)
- func (p *PhysicalApply) SetCorrelated()
- func (p *PhysicalApply) SetParents(pars ...Plan)
- func (p *PhysicalApply) SetSchema(schema expression.Schema)
- type PhysicalDummyScan
- func (p *PhysicalDummyScan) AddChild(child Plan)
- func (p *PhysicalDummyScan) AddParent(parent Plan)
- func (p *PhysicalDummyScan) Copy() PhysicalPlan
- func (p *PhysicalDummyScan) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalDummyScan) GetChildren() []Plan
- func (p *PhysicalDummyScan) GetID() string
- func (p *PhysicalDummyScan) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalDummyScan) GetParents() []Plan
- func (p *PhysicalDummyScan) GetSchema() expression.Schema
- func (p *PhysicalDummyScan) IsCorrelated() bool
- func (p *PhysicalDummyScan) MarshalJSON() ([]byte, error)
- func (p *PhysicalDummyScan) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalDummyScan) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalDummyScan) SetChildren(children ...Plan)
- func (p *PhysicalDummyScan) SetCorrelated()
- func (p *PhysicalDummyScan) SetParents(pars ...Plan)
- func (p *PhysicalDummyScan) SetSchema(schema expression.Schema)
- type PhysicalHashJoin
- func (p *PhysicalHashJoin) AddChild(child Plan)
- func (p *PhysicalHashJoin) AddParent(parent Plan)
- func (p *PhysicalHashJoin) Copy() PhysicalPlan
- func (p *PhysicalHashJoin) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalHashJoin) GetChildren() []Plan
- func (p *PhysicalHashJoin) GetID() string
- func (p *PhysicalHashJoin) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalHashJoin) GetParents() []Plan
- func (p *PhysicalHashJoin) GetSchema() expression.Schema
- func (p *PhysicalHashJoin) IsCorrelated() bool
- func (p *PhysicalHashJoin) MarshalJSON() ([]byte, error)
- func (p *PhysicalHashJoin) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalHashJoin) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalHashJoin) SetChildren(children ...Plan)
- func (p *PhysicalHashJoin) SetCorrelated()
- func (p *PhysicalHashJoin) SetParents(pars ...Plan)
- func (p *PhysicalHashJoin) SetSchema(schema expression.Schema)
- type PhysicalHashSemiJoin
- func (p *PhysicalHashSemiJoin) AddChild(child Plan)
- func (p *PhysicalHashSemiJoin) AddParent(parent Plan)
- func (p *PhysicalHashSemiJoin) Copy() PhysicalPlan
- func (p *PhysicalHashSemiJoin) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalHashSemiJoin) GetChildren() []Plan
- func (p *PhysicalHashSemiJoin) GetID() string
- func (p *PhysicalHashSemiJoin) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalHashSemiJoin) GetParents() []Plan
- func (p *PhysicalHashSemiJoin) GetSchema() expression.Schema
- func (p *PhysicalHashSemiJoin) IsCorrelated() bool
- func (p *PhysicalHashSemiJoin) MarshalJSON() ([]byte, error)
- func (p *PhysicalHashSemiJoin) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalHashSemiJoin) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalHashSemiJoin) SetChildren(children ...Plan)
- func (p *PhysicalHashSemiJoin) SetCorrelated()
- func (p *PhysicalHashSemiJoin) SetParents(pars ...Plan)
- func (p *PhysicalHashSemiJoin) SetSchema(schema expression.Schema)
- type PhysicalIndexScan
- type PhysicalMemTable
- func (p *PhysicalMemTable) AddChild(child Plan)
- func (p *PhysicalMemTable) AddParent(parent Plan)
- func (p *PhysicalMemTable) Copy() PhysicalPlan
- func (p *PhysicalMemTable) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalMemTable) GetChildren() []Plan
- func (p *PhysicalMemTable) GetID() string
- func (p *PhysicalMemTable) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalMemTable) GetParents() []Plan
- func (p *PhysicalMemTable) GetSchema() expression.Schema
- func (p *PhysicalMemTable) IsCorrelated() bool
- func (p *PhysicalMemTable) MarshalJSON() ([]byte, error)
- func (p *PhysicalMemTable) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalMemTable) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalMemTable) SetChildren(children ...Plan)
- func (p *PhysicalMemTable) SetCorrelated()
- func (p *PhysicalMemTable) SetParents(pars ...Plan)
- func (p *PhysicalMemTable) SetSchema(schema expression.Schema)
- type PhysicalPlan
- type PhysicalTableScan
- type PhysicalUnionScan
- func (p *PhysicalUnionScan) AddChild(child Plan)
- func (p *PhysicalUnionScan) AddParent(parent Plan)
- func (p *PhysicalUnionScan) Copy() PhysicalPlan
- func (p *PhysicalUnionScan) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalUnionScan) GetChildren() []Plan
- func (p *PhysicalUnionScan) GetID() string
- func (p *PhysicalUnionScan) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalUnionScan) GetParents() []Plan
- func (p *PhysicalUnionScan) GetSchema() expression.Schema
- func (p *PhysicalUnionScan) IsCorrelated() bool
- func (p *PhysicalUnionScan) MarshalJSON() ([]byte, error)
- func (p *PhysicalUnionScan) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalUnionScan) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalUnionScan) SetChildren(children ...Plan)
- func (p *PhysicalUnionScan) SetCorrelated()
- func (p *PhysicalUnionScan) SetParents(pars ...Plan)
- func (p *PhysicalUnionScan) SetSchema(schema expression.Schema)
- type Plan
- type Prepare
- func (p *Prepare) AddChild(child Plan)
- func (p *Prepare) AddParent(parent Plan)
- func (p *Prepare) GetChildByIndex(index int) (parent Plan)
- func (p *Prepare) GetChildren() []Plan
- func (p *Prepare) GetID() string
- func (p *Prepare) GetParentByIndex(index int) (parent Plan)
- func (p *Prepare) GetParents() []Plan
- func (p *Prepare) GetSchema() expression.Schema
- func (p *Prepare) IsCorrelated() bool
- func (p *Prepare) MarshalJSON() ([]byte, error)
- func (p *Prepare) ReplaceChild(child, newChild Plan) error
- func (p *Prepare) ReplaceParent(parent, newPar Plan) error
- func (p *Prepare) SetChildren(children ...Plan)
- func (p *Prepare) SetCorrelated()
- func (p *Prepare) SetParents(pars ...Plan)
- func (p *Prepare) SetSchema(schema expression.Schema)
- type Projection
- func (p *Projection) Copy() PhysicalPlan
- func (p *Projection) MarshalJSON() ([]byte, error)
- func (p *Projection) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
- func (p *Projection) PruneColumns(parentUsedCols []*expression.Column)
- func (p *Projection) ResolveIndicesAndCorCols()
- func (p *Projection) SetCorrelated()
- type SelectLock
- type Selection
- func (p *Selection) Copy() PhysicalPlan
- func (p *Selection) MarshalJSON() ([]byte, error)
- func (p *Selection) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *Selection) PruneColumns(parentUsedCols []*expression.Column)
- func (p *Selection) ResolveIndicesAndCorCols()
- func (p *Selection) SetCorrelated()
- type Set
- func (p *Set) AddChild(child Plan)
- func (p *Set) AddParent(parent Plan)
- func (p *Set) GetChildByIndex(index int) (parent Plan)
- func (p *Set) GetChildren() []Plan
- func (p *Set) GetID() string
- func (p *Set) GetParentByIndex(index int) (parent Plan)
- func (p *Set) GetParents() []Plan
- func (p *Set) GetSchema() expression.Schema
- func (p *Set) IsCorrelated() bool
- func (p *Set) MarshalJSON() ([]byte, error)
- func (p *Set) ReplaceChild(child, newChild Plan) error
- func (p *Set) ReplaceParent(parent, newPar Plan) error
- func (p *Set) SetChildren(children ...Plan)
- func (p *Set) SetCorrelated()
- func (p *Set) SetParents(pars ...Plan)
- func (p *Set) SetSchema(schema expression.Schema)
- type Show
- type ShowDDL
- func (p *ShowDDL) AddChild(child Plan)
- func (p *ShowDDL) AddParent(parent Plan)
- func (p *ShowDDL) GetChildByIndex(index int) (parent Plan)
- func (p *ShowDDL) GetChildren() []Plan
- func (p *ShowDDL) GetID() string
- func (p *ShowDDL) GetParentByIndex(index int) (parent Plan)
- func (p *ShowDDL) GetParents() []Plan
- func (p *ShowDDL) GetSchema() expression.Schema
- func (p *ShowDDL) IsCorrelated() bool
- func (p *ShowDDL) MarshalJSON() ([]byte, error)
- func (p *ShowDDL) ReplaceChild(child, newChild Plan) error
- func (p *ShowDDL) ReplaceParent(parent, newPar Plan) error
- func (p *ShowDDL) SetChildren(children ...Plan)
- func (p *ShowDDL) SetCorrelated()
- func (p *ShowDDL) SetParents(pars ...Plan)
- func (p *ShowDDL) SetSchema(schema expression.Schema)
- type Simple
- func (p *Simple) AddChild(child Plan)
- func (p *Simple) AddParent(parent Plan)
- func (p *Simple) GetChildByIndex(index int) (parent Plan)
- func (p *Simple) GetChildren() []Plan
- func (p *Simple) GetID() string
- func (p *Simple) GetParentByIndex(index int) (parent Plan)
- func (p *Simple) GetParents() []Plan
- func (p *Simple) GetSchema() expression.Schema
- func (p *Simple) IsCorrelated() bool
- func (p *Simple) MarshalJSON() ([]byte, error)
- func (p *Simple) ReplaceChild(child, newChild Plan) error
- func (p *Simple) ReplaceParent(parent, newPar Plan) error
- func (p *Simple) SetChildren(children ...Plan)
- func (p *Simple) SetCorrelated()
- func (p *Simple) SetParents(pars ...Plan)
- func (p *Simple) SetSchema(schema expression.Schema)
- type Sort
- func (p *Sort) Copy() PhysicalPlan
- func (p *Sort) MarshalJSON() ([]byte, error)
- func (p *Sort) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *Sort) PruneColumns(parentUsedCols []*expression.Column)
- func (p *Sort) ResolveIndicesAndCorCols()
- func (p *Sort) SetCorrelated()
- type TableDual
- type TableRange
- type Trim
- type Union
- type Update
Constants ¶
const ( CodeOperandColumns terror.ErrCode = 1 CodeInvalidWildCard terror.ErrCode = 3 CodeUnsupported terror.ErrCode = 4 CodeInvalidGroupFuncUse terror.ErrCode = 5 CodeIllegalReference terror.ErrCode = 6 )
Optimizer error codes.
const ( // Sel is the type of Selection. Sel = "Selection" // St is the type of Set. St = "Set" // Proj is the type of Projection. Proj = "Projection" // Agg is the type of Aggregation. Agg = "Aggregation" // Jn is the type of Join. Jn = "Join" // Un is the type of Union. Un = "Union" // Tbl is the type of TableScan. Tbl = "TableScan" // Idx is the type of IndexScan. Idx = "IndexScan" // Srt is the type of Sort. Srt = "Sort" // Lim is the type of Limit. Lim = "Limit" // App is the type of Apply. App = "Apply" // Dis is the type of Distinct. Dis = "Distinct" // Trm is the type of Trim. Trm = "Trim" // MOR is the type of MaxOneRow. MOR = "MaxOneRow" // Ext is the type of Exists. Ext = "Exists" // Dual is the type of TableDual. Dual = "TableDual" // Lock is the type of SelectLock. Lock = "SelectLock" // Load is the type of LoadData. Load = "LoadData" // Ins is the type of Insert Ins = "Insert" // Up is the type of Update. Up = "Update" // Del is the type of Delete. Del = "Delete" )
const ( CodeUnsupportedType terror.ErrCode = 1 SystemInternalError terror.ErrCode = 2 CodeAmbiguous terror.ErrCode = 1052 CodeUnknownColumn terror.ErrCode = 1054 CodeWrongArguments terror.ErrCode = 1210 )
Error codes.
Variables ¶
var ( ErrOperandColumns = terror.ClassOptimizer.New(CodeOperandColumns, "Operand should contain %d column(s)") ErrInvalidWildCard = terror.ClassOptimizer.New(CodeInvalidWildCard, "Wildcard fields without any table name appears in wrong place") ErrCartesianProductUnsupported = terror.ClassOptimizer.New(CodeUnsupported, "Cartesian product is unsupported") ErrInvalidGroupFuncUse = terror.ClassOptimizer.New(CodeInvalidGroupFuncUse, "Invalid use of group function") ErrIllegalReference = terror.ClassOptimizer.New(CodeIllegalReference, "Illegal reference") )
Optimizer base errors.
var ( ErrUnsupportedType = terror.ClassOptimizerPlan.New(CodeUnsupportedType, "Unsupported type") SystemInternalErrorType = terror.ClassOptimizerPlan.New(SystemInternalError, "System internal error") ErrUnknownColumn = terror.ClassOptimizerPlan.New(CodeUnknownColumn, "Unknown column '%s' in '%s'") ErrWrongArguments = terror.ClassOptimizerPlan.New(CodeWrongArguments, "Incorrect arguments to EXECUTE") ErrAmbiguous = terror.ClassOptimizerPlan.New(CodeAmbiguous, "Column '%s' in field list is ambiguous") )
Error instances.
var AllowCartesianProduct = true
AllowCartesianProduct means whether tidb allows cartesian join without equal conditions.
var EvalSubquery func(p PhysicalPlan, is infoschema.InfoSchema, ctx context.Context) ([]types.Datum, error)
EvalSubquery evaluates incorrelated subqueries once.
var JoinConcurrency = 5
JoinConcurrency means the number of goroutines that participate in joining.
Functions ¶
func InferType ¶
func InferType(sc *variable.StatementContext, node ast.Node) error
InferType infers result type for ast.ExprNode.
func InsertPlan ¶
InsertPlan means inserting plan between two plans.
Types ¶
type AggregateFuncExtractor ¶
type AggregateFuncExtractor struct { // AggFuncs is the collected AggregateFuncExprs. AggFuncs []*ast.AggregateFuncExpr // contains filtered or unexported fields }
AggregateFuncExtractor visits Expr tree. It converts ColunmNameExpr to AggregateFuncExpr and collects AggregateFuncExpr.
type Aggregation ¶
type Aggregation struct { AggFuncs []expression.AggregationFunction GroupByItems []expression.Expression // contains filtered or unexported fields }
Aggregation represents an aggregate plan.
func (*Aggregation) PredicatePushDown ¶
func (p *Aggregation) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Aggregation) PruneColumns ¶
func (p *Aggregation) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Aggregation) ResolveIndicesAndCorCols ¶
func (p *Aggregation) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
func (*Aggregation) SetCorrelated ¶
func (p *Aggregation) SetCorrelated()
SetCorrelated implements Plan interface.
type AggregationType ¶
type AggregationType int
AggregationType stands for the mode of aggregation plan.
const ( // StreamedAgg supposes its input is sorted by group by key. StreamedAgg AggregationType = iota // FinalAgg supposes its input is partial results. FinalAgg // CompleteAgg supposes its input is original results. CompleteAgg )
type Apply ¶
type Apply struct { Join // contains filtered or unexported fields }
Apply gets one row from outer executor and gets one row from inner executor according to outer row.
func (*Apply) PruneColumns ¶
func (p *Apply) PruneColumns(parentUseCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Apply) ResolveIndicesAndCorCols ¶
func (p *Apply) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
func (*Apply) SetCorrelated ¶
func (p *Apply) SetCorrelated()
SetCorrelated implements Plan interface.
type ApplyConditionChecker ¶
type ApplyConditionChecker struct { Condition expression.Expression All bool }
ApplyConditionChecker checks whether all or any output of apply matches a condition.
type ByItems ¶
type ByItems struct { Expr expression.Expression Desc bool }
ByItems wraps a "by" item.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache plan is a physical plan which stores the result of its child node.
func (*Cache) AddChild ¶
func (p *Cache) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Cache) AddParent ¶
func (p *Cache) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Cache) Copy ¶
func (p *Cache) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Cache) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Cache) GetChildren ¶
func (p *Cache) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Cache) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Cache) GetParents ¶
func (p *Cache) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Cache) GetSchema ¶
func (p *Cache) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Cache) IsCorrelated ¶
func (p *Cache) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Cache) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Cache) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Cache) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Cache) SetChildren ¶
func (p *Cache) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Cache) SetCorrelated ¶
func (p *Cache) SetCorrelated()
func (*Cache) SetParents ¶
func (p *Cache) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Cache) SetSchema ¶
func (p *Cache) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type CheckTable ¶
CheckTable is used for checking table data, built from the 'admin check table' statement.
func (*CheckTable) AddChild ¶
func (p *CheckTable) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*CheckTable) AddParent ¶
func (p *CheckTable) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*CheckTable) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*CheckTable) GetChildren ¶
func (p *CheckTable) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*CheckTable) GetID ¶
func (p *CheckTable) GetID() string
GetID implements Plan GetID interface.
func (*CheckTable) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*CheckTable) GetParents ¶
func (p *CheckTable) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*CheckTable) GetSchema ¶
func (p *CheckTable) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*CheckTable) IsCorrelated ¶
func (p *CheckTable) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*CheckTable) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*CheckTable) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*CheckTable) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*CheckTable) SetChildren ¶
func (p *CheckTable) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*CheckTable) SetCorrelated ¶
func (p *CheckTable) SetCorrelated()
func (*CheckTable) SetParents ¶
func (p *CheckTable) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*CheckTable) SetSchema ¶
func (p *CheckTable) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type DDL ¶
DDL represents a DDL statement plan.
func (*DDL) AddChild ¶
func (p *DDL) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*DDL) AddParent ¶
func (p *DDL) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*DDL) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*DDL) GetChildren ¶
func (p *DDL) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*DDL) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*DDL) GetParents ¶
func (p *DDL) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*DDL) GetSchema ¶
func (p *DDL) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*DDL) IsCorrelated ¶
func (p *DDL) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*DDL) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*DDL) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*DDL) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*DDL) SetChildren ¶
func (p *DDL) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*DDL) SetCorrelated ¶
func (p *DDL) SetCorrelated()
func (*DDL) SetParents ¶
func (p *DDL) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*DDL) SetSchema ¶
func (p *DDL) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type DataSource ¶
type DataSource struct { Columns []*model.ColumnInfo DBName *model.CIStr TableAsName *model.CIStr LimitCount *int64 // contains filtered or unexported fields }
DataSource represents a tablescan without condition push down.
func (*DataSource) PredicatePushDown ¶
func (p *DataSource) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*DataSource) PruneColumns ¶
func (p *DataSource) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*DataSource) ResolveIndicesAndCorCols ¶
func (p *DataSource) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Deallocate ¶
type Deallocate struct { Name string // contains filtered or unexported fields }
Deallocate represents deallocate plan.
func (*Deallocate) AddChild ¶
func (p *Deallocate) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Deallocate) AddParent ¶
func (p *Deallocate) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Deallocate) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Deallocate) GetChildren ¶
func (p *Deallocate) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Deallocate) GetID ¶
func (p *Deallocate) GetID() string
GetID implements Plan GetID interface.
func (*Deallocate) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Deallocate) GetParents ¶
func (p *Deallocate) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Deallocate) GetSchema ¶
func (p *Deallocate) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Deallocate) IsCorrelated ¶
func (p *Deallocate) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Deallocate) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Deallocate) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Deallocate) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Deallocate) SetChildren ¶
func (p *Deallocate) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Deallocate) SetCorrelated ¶
func (p *Deallocate) SetCorrelated()
func (*Deallocate) SetParents ¶
func (p *Deallocate) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Deallocate) SetSchema ¶
func (p *Deallocate) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Delete ¶
type Delete struct { Tables []*ast.TableName IsMultiTable bool // contains filtered or unexported fields }
Delete represents a delete plan.
func (*Delete) Copy ¶
func (p *Delete) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Delete) PredicatePushDown ¶
func (p *Delete) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Delete) PruneColumns ¶
func (p *Delete) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Delete) ResolveIndicesAndCorCols ¶
func (p *Delete) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Execute ¶
type Execute struct { Name string UsingVars []expression.Expression ID uint32 // contains filtered or unexported fields }
Execute represents prepare plan.
func (*Execute) AddChild ¶
func (p *Execute) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Execute) AddParent ¶
func (p *Execute) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Execute) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Execute) GetChildren ¶
func (p *Execute) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Execute) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Execute) GetParents ¶
func (p *Execute) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Execute) GetSchema ¶
func (p *Execute) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Execute) IsCorrelated ¶
func (p *Execute) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Execute) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Execute) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Execute) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Execute) SetChildren ¶
func (p *Execute) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Execute) SetCorrelated ¶
func (p *Execute) SetCorrelated()
func (*Execute) SetParents ¶
func (p *Execute) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Execute) SetSchema ¶
func (p *Execute) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Exists ¶
type Exists struct {
// contains filtered or unexported fields
}
Exists checks if a query returns result.
func (*Exists) Copy ¶
func (p *Exists) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Exists) PredicatePushDown ¶
func (p *Exists) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Exists) PruneColumns ¶
func (p *Exists) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Exists) ResolveIndicesAndCorCols ¶
func (p *Exists) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Explain ¶
type Explain struct { StmtPlan Plan // contains filtered or unexported fields }
Explain represents a explain plan.
func (*Explain) AddChild ¶
func (p *Explain) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Explain) AddParent ¶
func (p *Explain) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Explain) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Explain) GetChildren ¶
func (p *Explain) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Explain) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Explain) GetParents ¶
func (p *Explain) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Explain) GetSchema ¶
func (p *Explain) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Explain) IsCorrelated ¶
func (p *Explain) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Explain) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Explain) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Explain) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Explain) SetChildren ¶
func (p *Explain) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Explain) SetCorrelated ¶
func (p *Explain) SetCorrelated()
func (*Explain) SetParents ¶
func (p *Explain) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Explain) SetSchema ¶
func (p *Explain) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type IndexRange ¶
type IndexRange struct { LowVal []types.Datum LowExclude bool HighVal []types.Datum HighExclude bool }
IndexRange represents an index range to be scanned.
func (*IndexRange) IsPoint ¶
func (ir *IndexRange) IsPoint(sc *variable.StatementContext) bool
IsPoint returns if the index range is a point.
func (*IndexRange) String ¶
func (ir *IndexRange) String() string
type Insert ¶
type Insert struct { Table table.Table Columns []*ast.ColumnName Lists [][]expression.Expression Setlist []*expression.Assignment OnDuplicate []*expression.Assignment IsReplace bool Priority int Ignore bool // contains filtered or unexported fields }
Insert represents an insert plan.
func (*Insert) Copy ¶
func (p *Insert) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Insert) PredicatePushDown ¶
func (p *Insert) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Insert) PruneColumns ¶
func (p *Insert) PruneColumns(_ []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Insert) ResolveIndicesAndCorCols ¶
func (p *Insert) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Join ¶
type Join struct { JoinType JoinType EqualConditions []*expression.ScalarFunction LeftConditions []expression.Expression RightConditions []expression.Expression OtherConditions []expression.Expression // DefaultValues is only used for outer join, which stands for the default values when the outer table cannot find join partner // instead of null padding. DefaultValues []types.Datum // contains filtered or unexported fields }
Join is the logical join plan.
func (*Join) PredicatePushDown ¶
func (p *Join) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Join) PruneColumns ¶
func (p *Join) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Join) ResolveIndicesAndCorCols ¶
func (p *Join) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
func (*Join) SetCorrelated ¶
func (p *Join) SetCorrelated()
SetCorrelated implements Plan interface.
type JoinType ¶
type JoinType int
JoinType contains CrossJoin, InnerJoin, LeftOuterJoin, RightOuterJoin, FullOuterJoin, SemiJoin.
const ( // InnerJoin means inner join. InnerJoin JoinType = iota // LeftOuterJoin means left join. LeftOuterJoin // RightOuterJoin means right join. RightOuterJoin // SemiJoin means if row a in table A matches some rows in B, just output a. SemiJoin // LeftOuterSemiJoin means if row a in table A matches some rows in B, output (a, true), otherwise, output (a, false). LeftOuterSemiJoin )
type Limit ¶
Limit represents offset and limit plan.
func (*Limit) Copy ¶
func (p *Limit) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Limit) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Limit) PredicatePushDown ¶
func (p *Limit) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Limit) PruneColumns ¶
func (p *Limit) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Limit) ResolveIndicesAndCorCols ¶
func (p *Limit) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type LoadData ¶
type LoadData struct { IsLocal bool Path string Table *ast.TableName FieldsInfo *ast.FieldsClause LinesInfo *ast.LinesClause // contains filtered or unexported fields }
LoadData represents a loaddata plan.
func (*LoadData) AddChild ¶
func (p *LoadData) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*LoadData) AddParent ¶
func (p *LoadData) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*LoadData) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*LoadData) GetChildren ¶
func (p *LoadData) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*LoadData) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*LoadData) GetParents ¶
func (p *LoadData) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*LoadData) GetSchema ¶
func (p *LoadData) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*LoadData) IsCorrelated ¶
func (p *LoadData) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*LoadData) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*LoadData) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*LoadData) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*LoadData) SetChildren ¶
func (p *LoadData) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*LoadData) SetCorrelated ¶
func (p *LoadData) SetCorrelated()
func (*LoadData) SetParents ¶
func (p *LoadData) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*LoadData) SetSchema ¶
func (p *LoadData) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type LogicalPlan ¶
type LogicalPlan interface { Plan // PredicatePushDown pushes down the predicates in the where/on/having clauses as deeply as possible. // It will accept a predicate that is an expression slice, and return the expressions that can't be pushed. // Because it might change the root if the having clause exists, we need to return a plan that represents a new root. PredicatePushDown([]expression.Expression) ([]expression.Expression, LogicalPlan, error) // PruneColumns prunes the unused columns. PruneColumns([]*expression.Column) // ResolveIndicesAndCorCols resolves the index for columns and initializes the correlated columns. ResolveIndicesAndCorCols() // contains filtered or unexported methods }
LogicalPlan is a tree of logical operators. We can do a lot of logical optimizations to it, like predicate pushdown and column pruning.
type MaxOneRow ¶
type MaxOneRow struct {
// contains filtered or unexported fields
}
MaxOneRow checks if a query returns no more than one row.
func (*MaxOneRow) Copy ¶
func (p *MaxOneRow) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*MaxOneRow) PredicatePushDown ¶
func (p *MaxOneRow) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*MaxOneRow) PruneColumns ¶
func (p *MaxOneRow) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*MaxOneRow) ResolveIndicesAndCorCols ¶
func (p *MaxOneRow) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type PhysicalAggregation ¶
type PhysicalAggregation struct { HasGby bool AggType AggregationType AggFuncs []expression.AggregationFunction GroupByItems []expression.Expression // contains filtered or unexported fields }
PhysicalAggregation is Aggregation's physical plan.
func (*PhysicalAggregation) AddChild ¶
func (p *PhysicalAggregation) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalAggregation) AddParent ¶
func (p *PhysicalAggregation) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalAggregation) Copy ¶
func (p *PhysicalAggregation) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalAggregation) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalAggregation) GetChildren ¶
func (p *PhysicalAggregation) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalAggregation) GetID ¶
func (p *PhysicalAggregation) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalAggregation) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalAggregation) GetParents ¶
func (p *PhysicalAggregation) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalAggregation) GetSchema ¶
func (p *PhysicalAggregation) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalAggregation) IsCorrelated ¶
func (p *PhysicalAggregation) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalAggregation) MarshalJSON ¶
func (p *PhysicalAggregation) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*PhysicalAggregation) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalAggregation) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalAggregation) SetChildren ¶
func (p *PhysicalAggregation) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalAggregation) SetCorrelated ¶
func (p *PhysicalAggregation) SetCorrelated()
SetCorrelated implements Plan interface.
func (*PhysicalAggregation) SetParents ¶
func (p *PhysicalAggregation) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalAggregation) SetSchema ¶
func (p *PhysicalAggregation) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type PhysicalApply ¶
type PhysicalApply struct { PhysicalJoin PhysicalPlan OuterSchema []*expression.CorrelatedColumn // contains filtered or unexported fields }
PhysicalApply represents apply plan, only used for subquery.
func (*PhysicalApply) AddChild ¶
func (p *PhysicalApply) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalApply) AddParent ¶
func (p *PhysicalApply) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalApply) Copy ¶
func (p *PhysicalApply) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalApply) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalApply) GetChildren ¶
func (p *PhysicalApply) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalApply) GetID ¶
func (p *PhysicalApply) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalApply) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalApply) GetParents ¶
func (p *PhysicalApply) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalApply) GetSchema ¶
func (p *PhysicalApply) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalApply) IsCorrelated ¶
func (p *PhysicalApply) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalApply) MarshalJSON ¶
func (p *PhysicalApply) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*PhysicalApply) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalApply) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalApply) SetChildren ¶
func (p *PhysicalApply) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalApply) SetCorrelated ¶
func (p *PhysicalApply) SetCorrelated()
SetCorrelated implements Plan interface.
func (*PhysicalApply) SetParents ¶
func (p *PhysicalApply) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalApply) SetSchema ¶
func (p *PhysicalApply) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type PhysicalDummyScan ¶
type PhysicalDummyScan struct {
// contains filtered or unexported fields
}
PhysicalDummyScan is a dummy table that returns nothing.
func (*PhysicalDummyScan) AddChild ¶
func (p *PhysicalDummyScan) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalDummyScan) AddParent ¶
func (p *PhysicalDummyScan) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalDummyScan) Copy ¶
func (p *PhysicalDummyScan) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalDummyScan) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalDummyScan) GetChildren ¶
func (p *PhysicalDummyScan) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalDummyScan) GetID ¶
func (p *PhysicalDummyScan) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalDummyScan) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalDummyScan) GetParents ¶
func (p *PhysicalDummyScan) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalDummyScan) GetSchema ¶
func (p *PhysicalDummyScan) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalDummyScan) IsCorrelated ¶
func (p *PhysicalDummyScan) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalDummyScan) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*PhysicalDummyScan) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalDummyScan) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalDummyScan) SetChildren ¶
func (p *PhysicalDummyScan) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalDummyScan) SetCorrelated ¶
func (p *PhysicalDummyScan) SetCorrelated()
func (*PhysicalDummyScan) SetParents ¶
func (p *PhysicalDummyScan) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalDummyScan) SetSchema ¶
func (p *PhysicalDummyScan) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type PhysicalHashJoin ¶
type PhysicalHashJoin struct { JoinType JoinType EqualConditions []*expression.ScalarFunction LeftConditions []expression.Expression RightConditions []expression.Expression OtherConditions []expression.Expression SmallTable int Concurrency int DefaultValues []types.Datum // contains filtered or unexported fields }
PhysicalHashJoin represents hash join for inner/ outer join.
func (*PhysicalHashJoin) AddChild ¶
func (p *PhysicalHashJoin) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalHashJoin) AddParent ¶
func (p *PhysicalHashJoin) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalHashJoin) Copy ¶
func (p *PhysicalHashJoin) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalHashJoin) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalHashJoin) GetChildren ¶
func (p *PhysicalHashJoin) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalHashJoin) GetID ¶
func (p *PhysicalHashJoin) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalHashJoin) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalHashJoin) GetParents ¶
func (p *PhysicalHashJoin) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalHashJoin) GetSchema ¶
func (p *PhysicalHashJoin) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalHashJoin) IsCorrelated ¶
func (p *PhysicalHashJoin) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalHashJoin) MarshalJSON ¶
func (p *PhysicalHashJoin) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*PhysicalHashJoin) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalHashJoin) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalHashJoin) SetChildren ¶
func (p *PhysicalHashJoin) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalHashJoin) SetCorrelated ¶
func (p *PhysicalHashJoin) SetCorrelated()
SetCorrelated implements Plan interface.
func (*PhysicalHashJoin) SetParents ¶
func (p *PhysicalHashJoin) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalHashJoin) SetSchema ¶
func (p *PhysicalHashJoin) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type PhysicalHashSemiJoin ¶
type PhysicalHashSemiJoin struct { WithAux bool Anti bool EqualConditions []*expression.ScalarFunction LeftConditions []expression.Expression RightConditions []expression.Expression OtherConditions []expression.Expression // contains filtered or unexported fields }
PhysicalHashSemiJoin represents hash join for semi join.
func (*PhysicalHashSemiJoin) AddChild ¶
func (p *PhysicalHashSemiJoin) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalHashSemiJoin) AddParent ¶
func (p *PhysicalHashSemiJoin) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalHashSemiJoin) Copy ¶
func (p *PhysicalHashSemiJoin) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalHashSemiJoin) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalHashSemiJoin) GetChildren ¶
func (p *PhysicalHashSemiJoin) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalHashSemiJoin) GetID ¶
func (p *PhysicalHashSemiJoin) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalHashSemiJoin) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalHashSemiJoin) GetParents ¶
func (p *PhysicalHashSemiJoin) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalHashSemiJoin) GetSchema ¶
func (p *PhysicalHashSemiJoin) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalHashSemiJoin) IsCorrelated ¶
func (p *PhysicalHashSemiJoin) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalHashSemiJoin) MarshalJSON ¶
func (p *PhysicalHashSemiJoin) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*PhysicalHashSemiJoin) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalHashSemiJoin) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalHashSemiJoin) SetChildren ¶
func (p *PhysicalHashSemiJoin) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalHashSemiJoin) SetCorrelated ¶
func (p *PhysicalHashSemiJoin) SetCorrelated()
SetCorrelated implements Plan interface.
func (*PhysicalHashSemiJoin) SetParents ¶
func (p *PhysicalHashSemiJoin) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalHashSemiJoin) SetSchema ¶
func (p *PhysicalHashSemiJoin) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type PhysicalIndexScan ¶
type PhysicalIndexScan struct { Table *model.TableInfo Index *model.IndexInfo Ranges []*IndexRange Columns []*model.ColumnInfo DBName *model.CIStr Desc bool OutOfOrder bool // DoubleRead means if the index executor will read kv two times. // If the query requires the columns that don't belong to index, DoubleRead will be true. DoubleRead bool TableAsName *model.CIStr // contains filtered or unexported fields }
PhysicalIndexScan represents an index scan plan.
func (*PhysicalIndexScan) Copy ¶
func (p *PhysicalIndexScan) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalIndexScan) MarshalJSON ¶
func (p *PhysicalIndexScan) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
type PhysicalMemTable ¶
type PhysicalMemTable struct { DBName *model.CIStr Table *model.TableInfo Columns []*model.ColumnInfo Ranges []TableRange TableAsName *model.CIStr // contains filtered or unexported fields }
PhysicalMemTable reads memory table.
func (*PhysicalMemTable) AddChild ¶
func (p *PhysicalMemTable) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalMemTable) AddParent ¶
func (p *PhysicalMemTable) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalMemTable) Copy ¶
func (p *PhysicalMemTable) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalMemTable) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalMemTable) GetChildren ¶
func (p *PhysicalMemTable) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalMemTable) GetID ¶
func (p *PhysicalMemTable) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalMemTable) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalMemTable) GetParents ¶
func (p *PhysicalMemTable) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalMemTable) GetSchema ¶
func (p *PhysicalMemTable) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalMemTable) IsCorrelated ¶
func (p *PhysicalMemTable) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalMemTable) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*PhysicalMemTable) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalMemTable) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalMemTable) SetChildren ¶
func (p *PhysicalMemTable) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalMemTable) SetCorrelated ¶
func (p *PhysicalMemTable) SetCorrelated()
func (*PhysicalMemTable) SetParents ¶
func (p *PhysicalMemTable) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalMemTable) SetSchema ¶
func (p *PhysicalMemTable) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type PhysicalPlan ¶
type PhysicalPlan interface { json.Marshaler Plan // Copy copies the current plan. Copy() PhysicalPlan // contains filtered or unexported methods }
PhysicalPlan is a tree of the physical operators.
type PhysicalTableScan ¶
type PhysicalTableScan struct { Table *model.TableInfo Columns []*model.ColumnInfo DBName *model.CIStr Desc bool Ranges []TableRange TableAsName *model.CIStr // If sort data by scanning pkcol, KeepOrder should be true. KeepOrder bool // contains filtered or unexported fields }
PhysicalTableScan represents a table scan plan.
func (*PhysicalTableScan) Copy ¶
func (p *PhysicalTableScan) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalTableScan) MarshalJSON ¶
func (p *PhysicalTableScan) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
type PhysicalUnionScan ¶
type PhysicalUnionScan struct { Condition expression.Expression // contains filtered or unexported fields }
PhysicalUnionScan represents a union scan operator.
func (*PhysicalUnionScan) AddChild ¶
func (p *PhysicalUnionScan) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalUnionScan) AddParent ¶
func (p *PhysicalUnionScan) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalUnionScan) Copy ¶
func (p *PhysicalUnionScan) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalUnionScan) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalUnionScan) GetChildren ¶
func (p *PhysicalUnionScan) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalUnionScan) GetID ¶
func (p *PhysicalUnionScan) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalUnionScan) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalUnionScan) GetParents ¶
func (p *PhysicalUnionScan) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalUnionScan) GetSchema ¶
func (p *PhysicalUnionScan) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalUnionScan) IsCorrelated ¶
func (p *PhysicalUnionScan) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalUnionScan) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*PhysicalUnionScan) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalUnionScan) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalUnionScan) SetChildren ¶
func (p *PhysicalUnionScan) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalUnionScan) SetCorrelated ¶
func (p *PhysicalUnionScan) SetCorrelated()
func (*PhysicalUnionScan) SetParents ¶
func (p *PhysicalUnionScan) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalUnionScan) SetSchema ¶
func (p *PhysicalUnionScan) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Plan ¶
type Plan interface { // AddParent means appending a parent for plan. AddParent(parent Plan) // AddChild means appending a child for plan. AddChild(children Plan) // ReplaceParent means replacing a parent with another one. ReplaceParent(parent, newPar Plan) error // ReplaceChild means replacing a child with another one. ReplaceChild(children, newChild Plan) error // Retrieve the parent by index. GetParentByIndex(index int) Plan // Retrieve the child by index. GetChildByIndex(index int) Plan // Get all the parents. GetParents() []Plan // Get all the children. GetChildren() []Plan // Set the schema. SetSchema(schema expression.Schema) // Get the schema. GetSchema() expression.Schema // Get the ID. GetID() string IsCorrelated() bool // A plan will be correlated if one of its expressions or its child plans is correlated, except Apply. // As for Apply, it will be correlated if the outer plan is correlated or the inner plan has column that the outer doesn't has. // It will be called in the final step of logical plan building and the PhysicalInitialize process after convert2PhysicalPlan process. SetCorrelated() // SetParents sets the parents for the plan. SetParents(...Plan) // SetParents sets the children for the plan. SetChildren(...Plan) // contains filtered or unexported methods }
Plan is the description of an execution flow. It is created from ast.Node first, then optimized by the optimizer, finally used by the executor to create a Cursor which executes the statement.
func Optimize ¶
func Optimize(ctx context.Context, node ast.Node, is infoschema.InfoSchema) (Plan, error)
Optimize does optimization and creates a Plan. The node must be prepared first.
type Prepare ¶
Prepare represents prepare plan.
func (*Prepare) AddChild ¶
func (p *Prepare) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Prepare) AddParent ¶
func (p *Prepare) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Prepare) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Prepare) GetChildren ¶
func (p *Prepare) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Prepare) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Prepare) GetParents ¶
func (p *Prepare) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Prepare) GetSchema ¶
func (p *Prepare) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Prepare) IsCorrelated ¶
func (p *Prepare) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Prepare) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Prepare) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Prepare) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Prepare) SetChildren ¶
func (p *Prepare) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Prepare) SetCorrelated ¶
func (p *Prepare) SetCorrelated()
func (*Prepare) SetParents ¶
func (p *Prepare) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Prepare) SetSchema ¶
func (p *Prepare) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Projection ¶
type Projection struct { Exprs []expression.Expression // contains filtered or unexported fields }
Projection represents a select fields plan.
func (*Projection) Copy ¶
func (p *Projection) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Projection) MarshalJSON ¶
func (p *Projection) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*Projection) PredicatePushDown ¶
func (p *Projection) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Projection) PruneColumns ¶
func (p *Projection) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Projection) ResolveIndicesAndCorCols ¶
func (p *Projection) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
func (*Projection) SetCorrelated ¶
func (p *Projection) SetCorrelated()
SetCorrelated implements Plan interface.
type SelectLock ¶
type SelectLock struct { Lock ast.SelectLockType // contains filtered or unexported fields }
SelectLock represents a select lock plan.
func (*SelectLock) Copy ¶
func (p *SelectLock) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*SelectLock) PredicatePushDown ¶
func (p *SelectLock) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*SelectLock) PruneColumns ¶
func (p *SelectLock) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*SelectLock) ResolveIndicesAndCorCols ¶
func (p *SelectLock) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Selection ¶
type Selection struct { // Originally the WHERE or ON condition is parsed into a single expression, // but after we converted to CNF(Conjunctive normal form), it can be // split into a list of AND conditions. Conditions []expression.Expression // contains filtered or unexported fields }
Selection means a filter.
func (*Selection) Copy ¶
func (p *Selection) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Selection) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Selection) PredicatePushDown ¶
func (p *Selection) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Selection) PruneColumns ¶
func (p *Selection) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Selection) ResolveIndicesAndCorCols ¶
func (p *Selection) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
func (*Selection) SetCorrelated ¶
func (p *Selection) SetCorrelated()
SetCorrelated implements Plan interface.
type Set ¶
type Set struct { VarAssigns []*expression.VarAssignment // contains filtered or unexported fields }
Set represents a plan for set stmt.
func (*Set) AddChild ¶
func (p *Set) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Set) AddParent ¶
func (p *Set) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Set) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Set) GetChildren ¶
func (p *Set) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Set) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Set) GetParents ¶
func (p *Set) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Set) GetSchema ¶
func (p *Set) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Set) IsCorrelated ¶
func (p *Set) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Set) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Set) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Set) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Set) SetChildren ¶
func (p *Set) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Set) SetCorrelated ¶
func (p *Set) SetCorrelated()
func (*Set) SetParents ¶
func (p *Set) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Set) SetSchema ¶
func (p *Set) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Show ¶
type Show struct { Tp ast.ShowStmtType // Databases/Tables/Columns/.... DBName string Table *ast.TableName // Used for showing columns. Column *ast.ColumnName // Used for `desc table column`. Flag int // Some flag parsed from sql, such as FULL. Full bool User string // Used for show grants. // Used by show variables GlobalScope bool // contains filtered or unexported fields }
Show represents a show plan.
func (*Show) Copy ¶
func (p *Show) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Show) PredicatePushDown ¶
func (p *Show) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Show) PruneColumns ¶
func (p *Show) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Show) ResolveIndicesAndCorCols ¶
func (p *Show) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type ShowDDL ¶
type ShowDDL struct {
// contains filtered or unexported fields
}
ShowDDL is for showing DDL information.
func (*ShowDDL) AddChild ¶
func (p *ShowDDL) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*ShowDDL) AddParent ¶
func (p *ShowDDL) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*ShowDDL) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*ShowDDL) GetChildren ¶
func (p *ShowDDL) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*ShowDDL) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*ShowDDL) GetParents ¶
func (p *ShowDDL) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*ShowDDL) GetSchema ¶
func (p *ShowDDL) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*ShowDDL) IsCorrelated ¶
func (p *ShowDDL) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*ShowDDL) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*ShowDDL) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*ShowDDL) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*ShowDDL) SetChildren ¶
func (p *ShowDDL) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*ShowDDL) SetCorrelated ¶
func (p *ShowDDL) SetCorrelated()
func (*ShowDDL) SetParents ¶
func (p *ShowDDL) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*ShowDDL) SetSchema ¶
func (p *ShowDDL) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Simple ¶
Simple represents a simple statement plan which doesn't need any optimization.
func (*Simple) AddChild ¶
func (p *Simple) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Simple) AddParent ¶
func (p *Simple) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Simple) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Simple) GetChildren ¶
func (p *Simple) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Simple) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Simple) GetParents ¶
func (p *Simple) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Simple) GetSchema ¶
func (p *Simple) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Simple) IsCorrelated ¶
func (p *Simple) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Simple) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Simple) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Simple) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Simple) SetChildren ¶
func (p *Simple) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Simple) SetCorrelated ¶
func (p *Simple) SetCorrelated()
func (*Simple) SetParents ¶
func (p *Simple) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Simple) SetSchema ¶
func (p *Simple) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
type Sort ¶
Sort stands for the order by plan.
func (*Sort) Copy ¶
func (p *Sort) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Sort) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Sort) PredicatePushDown ¶
func (p *Sort) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Sort) PruneColumns ¶
func (p *Sort) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Sort) ResolveIndicesAndCorCols ¶
func (p *Sort) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
func (*Sort) SetCorrelated ¶
func (p *Sort) SetCorrelated()
SetCorrelated implements Plan interface.
type TableDual ¶
type TableDual struct {
// contains filtered or unexported fields
}
TableDual represents a dual table plan.
func (*TableDual) Copy ¶
func (p *TableDual) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*TableDual) PredicatePushDown ¶
func (p *TableDual) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*TableDual) PruneColumns ¶
func (p *TableDual) PruneColumns(_ []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*TableDual) ResolveIndicesAndCorCols ¶
func (p *TableDual) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type TableRange ¶
TableRange represents a range of row handle.
type Trim ¶
type Trim struct {
// contains filtered or unexported fields
}
Trim trims extra columns in src rows.
func (*Trim) Copy ¶
func (p *Trim) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Trim) PredicatePushDown ¶
func (p *Trim) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Trim) PruneColumns ¶
func (p *Trim) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Trim) ResolveIndicesAndCorCols ¶
func (p *Trim) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Union ¶
type Union struct {
// contains filtered or unexported fields
}
Union represents Union plan.
func (*Union) Copy ¶
func (p *Union) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Union) PredicatePushDown ¶
func (p *Union) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Union) PruneColumns ¶
func (p *Union) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Union) ResolveIndicesAndCorCols ¶
func (p *Union) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
type Update ¶
type Update struct { OrderedList []*expression.Assignment // contains filtered or unexported fields }
Update represents Update plan.
func (*Update) Copy ¶
func (p *Update) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Update) PredicatePushDown ¶
func (p *Update) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan interface.
func (*Update) PruneColumns ¶
func (p *Update) PruneColumns(parentUsedCols []*expression.Column)
PruneColumns implements LogicalPlan interface.
func (*Update) ResolveIndicesAndCorCols ¶
func (p *Update) ResolveIndicesAndCorCols()
ResolveIndicesAndCorCols implements LogicalPlan interface.
Source Files ¶
- aggregation_push_down.go
- build_key_info.go
- column_pruning.go
- decorrelate.go
- expression_rewriter.go
- join_reorder.go
- logical_plan_builder.go
- logical_plans.go
- match_property.go
- optimizer.go
- physical_plan_builder.go
- physical_plans.go
- plan.go
- planbuilder.go
- plans.go
- predicate_push_down.go
- range.go
- refiner.go
- stringer.go
- typeinferer.go
- util.go
- validator.go