Documentation ¶
Index ¶
- Constants
- Variables
- func InferType(node ast.Node) error
- func InsertPlan(parent Plan, child Plan, insert Plan) error
- func MockResolveName(node ast.Node, info infoschema.InfoSchema, defaultSchema string, ...) error
- func PrepareStmt(is infoschema.InfoSchema, ctx context.Context, node ast.Node) error
- func Preprocess(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
- func RemovePlan(p Plan) error
- func ResolveName(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
- func ToString(p Plan) string
- func UnionColumns(leftExpr *expression.Column, rightExpr *expression.Column, ...)
- func Validate(node ast.Node, inPrepare bool) error
- type Aggregation
- type AggregationType
- type Apply
- type ApplyConditionChecker
- type ByItems
- type CheckTable
- func (p *CheckTable) AddChild(child Plan)
- func (p *CheckTable) AddParent(parent Plan)
- func (p *CheckTable) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- func (p *Deallocate) SetParents(pars ...Plan)
- func (p *Deallocate) SetSchema(schema expression.Schema)
- type Delete
- type Distinct
- type Execute
- func (p *Execute) AddChild(child Plan)
- func (p *Execute) AddParent(parent Plan)
- func (p *Execute) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- func (p *Explain) SetParents(pars ...Plan)
- func (p *Explain) SetSchema(schema expression.Schema)
- type Filter
- func (p *Filter) AddChild(child Plan)
- func (p *Filter) AddParent(parent Plan)
- func (p *Filter) Fields() []*ast.ResultField
- func (p *Filter) GetChildByIndex(index int) (parent Plan)
- func (p *Filter) GetChildren() []Plan
- func (p *Filter) GetID() string
- func (p *Filter) GetParentByIndex(index int) (parent Plan)
- func (p *Filter) GetParents() []Plan
- func (p *Filter) GetSchema() expression.Schema
- func (p *Filter) IsCorrelated() bool
- func (p *Filter) MarshalJSON() ([]byte, error)
- func (p *Filter) ReplaceChild(child, newChild Plan) error
- func (p *Filter) ReplaceParent(parent, newPar Plan) error
- func (p *Filter) SetChildren(children ...Plan)
- func (p *Filter) SetFields(fields []*ast.ResultField)
- func (p *Filter) SetParents(pars ...Plan)
- func (p *Filter) 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) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- type LoadData
- func (p *LoadData) AddChild(child Plan)
- func (p *LoadData) AddParent(parent Plan)
- func (p *LoadData) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- func (p *PhysicalHashSemiJoin) SetParents(pars ...Plan)
- func (p *PhysicalHashSemiJoin) SetSchema(schema expression.Schema)
- type PhysicalIndexScan
- func (p *PhysicalIndexScan) AddChild(child Plan)
- func (p *PhysicalIndexScan) AddParent(parent Plan)
- func (p *PhysicalIndexScan) Copy() PhysicalPlan
- func (p *PhysicalIndexScan) Fields() []*ast.ResultField
- func (p *PhysicalIndexScan) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalIndexScan) GetChildren() []Plan
- func (p *PhysicalIndexScan) GetID() string
- func (p *PhysicalIndexScan) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalIndexScan) GetParents() []Plan
- func (p *PhysicalIndexScan) GetSchema() expression.Schema
- func (p *PhysicalIndexScan) IsCorrelated() bool
- func (p *PhysicalIndexScan) MarshalJSON() ([]byte, error)
- func (p *PhysicalIndexScan) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalIndexScan) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalIndexScan) SetChildren(children ...Plan)
- func (p *PhysicalIndexScan) SetFields(fields []*ast.ResultField)
- func (p *PhysicalIndexScan) SetParents(pars ...Plan)
- func (p *PhysicalIndexScan) SetSchema(schema expression.Schema)
- type PhysicalPlan
- type PhysicalTableScan
- func (p *PhysicalTableScan) AddChild(child Plan)
- func (p *PhysicalTableScan) AddParent(parent Plan)
- func (p *PhysicalTableScan) Copy() PhysicalPlan
- func (p *PhysicalTableScan) Fields() []*ast.ResultField
- func (p *PhysicalTableScan) GetChildByIndex(index int) (parent Plan)
- func (p *PhysicalTableScan) GetChildren() []Plan
- func (p *PhysicalTableScan) GetID() string
- func (p *PhysicalTableScan) GetParentByIndex(index int) (parent Plan)
- func (p *PhysicalTableScan) GetParents() []Plan
- func (p *PhysicalTableScan) GetSchema() expression.Schema
- func (p *PhysicalTableScan) IsCorrelated() bool
- func (p *PhysicalTableScan) MarshalJSON() ([]byte, error)
- func (p *PhysicalTableScan) ReplaceChild(child, newChild Plan) error
- func (p *PhysicalTableScan) ReplaceParent(parent, newPar Plan) error
- func (p *PhysicalTableScan) SetChildren(children ...Plan)
- func (p *PhysicalTableScan) SetFields(fields []*ast.ResultField)
- func (p *PhysicalTableScan) SetParents(pars ...Plan)
- func (p *PhysicalTableScan) SetSchema(schema expression.Schema)
- type PhysicalUnionScan
- func (p *PhysicalUnionScan) AddChild(child Plan)
- func (p *PhysicalUnionScan) AddParent(parent Plan)
- func (p *PhysicalUnionScan) Copy() PhysicalPlan
- func (p *PhysicalUnionScan) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- type SelectLock
- type Selection
- func (p *Selection) Copy() PhysicalPlan
- func (p *Selection) MarshalJSON() ([]byte, error)
- func (p *Selection) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retP LogicalPlan, err error)
- func (p *Selection) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- type Show
- func (p *Show) AddChild(child Plan)
- func (p *Show) AddParent(parent Plan)
- func (p *Show) Fields() []*ast.ResultField
- func (p *Show) GetChildByIndex(index int) (parent Plan)
- func (p *Show) GetChildren() []Plan
- func (p *Show) GetID() string
- func (p *Show) GetParentByIndex(index int) (parent Plan)
- func (p *Show) GetParents() []Plan
- func (p *Show) GetSchema() expression.Schema
- func (p *Show) IsCorrelated() bool
- func (p *Show) MarshalJSON() ([]byte, error)
- func (p *Show) ReplaceChild(child, newChild Plan) error
- func (p *Show) ReplaceParent(parent, newPar Plan) error
- func (p *Show) SetChildren(children ...Plan)
- func (p *Show) SetFields(fields []*ast.ResultField)
- func (p *Show) SetParents(pars ...Plan)
- func (p *Show) SetSchema(schema expression.Schema)
- type ShowDDL
- func (p *ShowDDL) AddChild(child Plan)
- func (p *ShowDDL) AddParent(parent Plan)
- func (p *ShowDDL) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) Fields() []*ast.ResultField
- 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) SetFields(fields []*ast.ResultField)
- 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) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- type TableDual
- type TableRange
- type Trim
- type Union
- type Update
Constants ¶
const ( CodeOneColumn terror.ErrCode = 1 CodeSameColumns terror.ErrCode = 2 CodeMultiWildCard 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" // 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" // Ts is the type of TableScan. Ts = "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 )
Error codes.
Variables ¶
var ( ErrOneColumn = terror.ClassOptimizer.New(CodeOneColumn, "Operand should contain 1 column(s)") ErrSameColumns = terror.ClassOptimizer.New(CodeSameColumns, "Operands should contain same columns") ErrMultiWildCard = terror.ClassOptimizer.New(CodeMultiWildCard, "wildcard field exist more than once") ErrUnSupported = terror.ClassOptimizer.New(CodeUnsupported, "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") )
Error instances.
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 InsertPlan ¶
InsertPlan means inserting plan between two plans.
func MockResolveName ¶
func MockResolveName(node ast.Node, info infoschema.InfoSchema, defaultSchema string, ctx context.Context) error
MockResolveName only serves for test.
func PrepareStmt ¶
func PrepareStmt(is infoschema.InfoSchema, ctx context.Context, node ast.Node) error
PrepareStmt prepares a raw statement parsed from parser. The statement must be prepared before it can be passed to optimize function. We pass InfoSchema instead of getting from Context in case it is changed after resolving name.
func Preprocess ¶
func Preprocess(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
Preprocess does preprocess work for optimizer.
func ResolveName ¶
func ResolveName(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
ResolveName resolves table name and column name. It generates ResultFields for ResultSetNode and resolves ColumnNameExpr to a ResultField.
func UnionColumns ¶
func UnionColumns(leftExpr *expression.Column, rightExpr *expression.Column, multipleEqualities map[*expression.Column]*expression.Column)
UnionColumns uses union-find to build multiple equality predicates.
Types ¶
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) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Aggregation) PruneColumnsAndResolveIndices ¶
func (p *Aggregation) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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 { InnerPlan LogicalPlan OuterSchema expression.Schema Checker *ApplyConditionChecker // 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) PredicatePushDown ¶
func (p *Apply) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Apply) PruneColumnsAndResolveIndices ¶
func (p *Apply) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface. e.g. For query select b.c, (select count(*) from a where a.id = b.id) from b. Its plan is Projection->Apply->TableScan. The schema of b is (a,b,c,id). When Pruning Apply, the parentUsedCols is (c, extra), outerSchema is (a,b,c,id). Then after pruning inner plan, the childOuterUsedCols schema in apply becomes (id). Now there're two columns in parentUsedCols, c is the column from Apply's child ---- TableScan, but extra isn't. So only c in parentUsedCols and id in outerSchema can be passed to TableScan.
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 CheckTable ¶
CheckTable is for checking table data.
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) Fields ¶
func (p *CheckTable) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *CheckTable) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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) Fields ¶
func (p *DDL) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *DDL) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 { Table *model.TableInfo Columns []*model.ColumnInfo DBName *model.CIStr Desc bool 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) PruneColumnsAndResolveIndices ¶
func (p *DataSource) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) Fields ¶
func (p *Deallocate) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *Deallocate) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 PredicatePushDown interface.
func (*Delete) PruneColumnsAndResolveIndices ¶
func (p *Delete) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface.
type Distinct ¶
type Distinct struct {
// contains filtered or unexported fields
}
Distinct represents Distinct plan.
func (*Distinct) Copy ¶
func (p *Distinct) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*Distinct) PredicatePushDown ¶
func (p *Distinct) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Distinct) PruneColumnsAndResolveIndices ¶
func (p *Distinct) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface.
type Execute ¶
type Execute struct { Name string UsingVars []ast.ExprNode 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) Fields ¶
func (p *Execute) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *Execute) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 PredicatePushDown interface.
func (*Exists) PruneColumnsAndResolveIndices ¶
func (p *Exists) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) Fields ¶
func (p *Explain) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *Explain) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 Filter ¶
type Filter 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 []ast.ExprNode // contains filtered or unexported fields }
Filter represents a plan that filter GetChildByIndex(0)plan result.
func (*Filter) AddChild ¶
func (p *Filter) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Filter) AddParent ¶
func (p *Filter) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Filter) Fields ¶
func (p *Filter) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Filter) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Filter) GetChildren ¶
func (p *Filter) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Filter) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Filter) GetParents ¶
func (p *Filter) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Filter) GetSchema ¶
func (p *Filter) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Filter) IsCorrelated ¶
func (p *Filter) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Filter) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Filter) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Filter) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Filter) SetChildren ¶
func (p *Filter) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Filter) SetFields ¶
func (p *Filter) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Filter) SetParents ¶
func (p *Filter) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Filter) SetSchema ¶
func (p *Filter) 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() bool
IsPoint returns if the index range is a point.
func (*IndexRange) String ¶
func (ir *IndexRange) String() string
type Insert ¶
type Insert struct { Table *ast.TableRefsClause Columns []*ast.ColumnName Lists [][]ast.ExprNode Setlist []*ast.Assignment OnDuplicate []*ast.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 PredicatePushDown interface.
func (*Insert) PruneColumnsAndResolveIndices ¶
func (p *Insert) PruneColumnsAndResolveIndices(_ []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface.
type Join ¶
type Join struct { JoinType JoinType EqualConditions []*expression.ScalarFunction LeftConditions []expression.Expression RightConditions []expression.Expression OtherConditions []expression.Expression // 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) PruneColumnsAndResolveIndices ¶
func (p *Join) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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 // SemiJoinWithAux means if row a in table A matches some rows in B, output (a, true), otherwise, output (a, false). SemiJoinWithAux )
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) PruneColumnsAndResolveIndices ¶
func (p *Limit) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) Fields ¶
func (p *LoadData) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *LoadData) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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) // PruneColumnsAndResolveIndices prunes the unused columns and resolves the index for columns. // This function returns a column slice representing columns from the outer environment and an error. // We need to return the outer columns, because the Apply plan will prune the inner Planner and it will know // the exact number of columns referenced by the inner plan. PruneColumnsAndResolveIndices([]*expression.Column) ([]*expression.Column, error) // 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.
func EliminateProjection ¶
func EliminateProjection(p LogicalPlan) LogicalPlan
EliminateProjection eliminates projection operator to avoid the cost of memory copy in the iterator of projection.
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) PruneColumnsAndResolveIndices ¶
func (p *MaxOneRow) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) Fields ¶
func (p *PhysicalAggregation) Fields() []*ast.ResultField
Fields implements Plan Fields 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 ¶
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) SetFields ¶
func (p *PhysicalAggregation) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields 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 { InnerPlan PhysicalPlan OuterSchema expression.Schema Checker *ApplyConditionChecker // 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) Fields ¶
func (p *PhysicalApply) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *PhysicalApply) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields 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) Fields ¶
func (p *PhysicalDummyScan) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *PhysicalDummyScan) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 // 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) Fields ¶
func (p *PhysicalHashJoin) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *PhysicalHashJoin) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields 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) Fields ¶
func (p *PhysicalHashSemiJoin) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *PhysicalHashSemiJoin) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields 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 AccessCondition []expression.Expression TableAsName *model.CIStr // contains filtered or unexported fields }
PhysicalIndexScan represents an index scan plan.
func (*PhysicalIndexScan) AddChild ¶
func (p *PhysicalIndexScan) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalIndexScan) AddParent ¶
func (p *PhysicalIndexScan) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalIndexScan) Copy ¶
func (p *PhysicalIndexScan) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalIndexScan) Fields ¶
func (p *PhysicalIndexScan) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*PhysicalIndexScan) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalIndexScan) GetChildren ¶
func (p *PhysicalIndexScan) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalIndexScan) GetID ¶
func (p *PhysicalIndexScan) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalIndexScan) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalIndexScan) GetParents ¶
func (p *PhysicalIndexScan) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalIndexScan) GetSchema ¶
func (p *PhysicalIndexScan) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalIndexScan) IsCorrelated ¶
func (p *PhysicalIndexScan) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalIndexScan) MarshalJSON ¶
func (p *PhysicalIndexScan) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*PhysicalIndexScan) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalIndexScan) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalIndexScan) SetChildren ¶
func (p *PhysicalIndexScan) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalIndexScan) SetFields ¶
func (p *PhysicalIndexScan) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*PhysicalIndexScan) SetParents ¶
func (p *PhysicalIndexScan) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalIndexScan) SetSchema ¶
func (p *PhysicalIndexScan) 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 AccessCondition []expression.Expression 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) AddChild ¶
func (p *PhysicalTableScan) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*PhysicalTableScan) AddParent ¶
func (p *PhysicalTableScan) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*PhysicalTableScan) Copy ¶
func (p *PhysicalTableScan) Copy() PhysicalPlan
Copy implements the PhysicalPlan Copy interface.
func (*PhysicalTableScan) Fields ¶
func (p *PhysicalTableScan) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*PhysicalTableScan) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*PhysicalTableScan) GetChildren ¶
func (p *PhysicalTableScan) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*PhysicalTableScan) GetID ¶
func (p *PhysicalTableScan) GetID() string
GetID implements Plan GetID interface.
func (*PhysicalTableScan) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*PhysicalTableScan) GetParents ¶
func (p *PhysicalTableScan) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*PhysicalTableScan) GetSchema ¶
func (p *PhysicalTableScan) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*PhysicalTableScan) IsCorrelated ¶
func (p *PhysicalTableScan) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*PhysicalTableScan) MarshalJSON ¶
func (p *PhysicalTableScan) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*PhysicalTableScan) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*PhysicalTableScan) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*PhysicalTableScan) SetChildren ¶
func (p *PhysicalTableScan) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalTableScan) SetFields ¶
func (p *PhysicalTableScan) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*PhysicalTableScan) SetParents ¶
func (p *PhysicalTableScan) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*PhysicalTableScan) SetSchema ¶
func (p *PhysicalTableScan) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema 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) Fields ¶
func (p *PhysicalUnionScan) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *PhysicalUnionScan) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 { // Fields returns the result fields of the plan. Fields() []*ast.ResultField // SetFields sets the results fields of the plan. SetFields(fields []*ast.ResultField) // 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 // SetParents sets the parents for the plan. SetParents(...Plan) // SetParents sets the children for the plan. SetChildren(...Plan) }
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) Fields ¶
func (p *Prepare) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *Prepare) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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) PruneColumnsAndResolveIndices ¶
func (p *Projection) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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 PredicatePushDown interface.
func (*SelectLock) PruneColumnsAndResolveIndices ¶
func (p *SelectLock) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) (ret []expression.Expression, retP LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*Selection) PruneColumnsAndResolveIndices ¶
func (p *Selection) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) AddChild ¶
func (p *Show) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Show) AddParent ¶
func (p *Show) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Show) Fields ¶
func (p *Show) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Show) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Show) GetChildren ¶
func (p *Show) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Show) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Show) GetParents ¶
func (p *Show) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Show) GetSchema ¶
func (p *Show) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Show) IsCorrelated ¶
func (p *Show) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Show) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Show) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Show) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Show) SetChildren ¶
func (p *Show) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Show) SetFields ¶
func (p *Show) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Show) SetParents ¶
func (p *Show) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Show) SetSchema ¶
func (p *Show) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema 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) Fields ¶
func (p *ShowDDL) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *ShowDDL) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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) Fields ¶
func (p *Simple) Fields() []*ast.ResultField
Fields implements Plan Fields 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) SetFields ¶
func (p *Simple) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
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 PredicatePushDown interface.
func (*Sort) PruneColumnsAndResolveIndices ¶
func (p *Sort) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) PruneColumnsAndResolveIndices ¶
func (p *TableDual) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface.
type TableRange ¶
TableRange represents a range of row handle.
type Trim ¶
type Trim struct {
// contains filtered or unexported fields
}
Trim trims child's 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 PredicatePushDown interface.
func (*Trim) PruneColumnsAndResolveIndices ¶
func (p *Trim) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) PruneColumnsAndResolveIndices ¶
func (p *Union) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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 PredicatePushDown interface.
func (*Update) PruneColumnsAndResolveIndices ¶
func (p *Update) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface. Update do not prune columns. Here we just do two things: 1. resolve indices for schema 2. reorder OrderedList
Source Files ¶
- column_pruning.go
- eliminate_projection.go
- expr_to_pb.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
- preprocess.go
- range.go
- refiner.go
- resolver.go
- stringer.go
- typeinferer.go
- validator.go
Directories ¶
Path | Synopsis |
---|---|
Package statistics is a generated protocol buffer package.
|
Package statistics is a generated protocol buffer package. |