Documentation ¶
Index ¶
- Constants
- Variables
- func EstimateCost(p Plan) float64
- 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 Refine(p Plan) error
- func RemovePlan(p Plan) error
- func ResolveName(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
- func ToString(p Plan) string
- func Validate(node ast.Node, inPrepare bool) error
- type Aggregate
- func (p *Aggregate) AddChild(child Plan)
- func (p *Aggregate) AddParent(parent Plan)
- func (p *Aggregate) Fields() []*ast.ResultField
- func (p *Aggregate) GetChildByIndex(index int) (parent Plan)
- func (p *Aggregate) GetChildren() []Plan
- func (p *Aggregate) GetID() string
- func (p *Aggregate) GetParentByIndex(index int) (parent Plan)
- func (p *Aggregate) GetParents() []Plan
- func (p *Aggregate) GetSchema() expression.Schema
- func (p *Aggregate) IsCorrelated() bool
- func (p *Aggregate) ReplaceChild(child, newChild Plan) error
- func (p *Aggregate) ReplaceParent(parent, newPar Plan) error
- func (p *Aggregate) RowCount() float64
- func (p *Aggregate) SetChildren(children ...Plan)
- func (p *Aggregate) SetFields(fields []*ast.ResultField)
- func (p *Aggregate) SetLimit(limit float64)
- func (p *Aggregate) SetParents(pars ...Plan)
- func (p *Aggregate) SetSchema(schema expression.Schema)
- func (p *Aggregate) StartupCost() float64
- func (p *Aggregate) TotalCost() float64
- type AggregateFuncExtractor
- type Aggregation
- 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) ReplaceChild(child, newChild Plan) error
- func (p *CheckTable) ReplaceParent(parent, newPar Plan) error
- func (p *CheckTable) RowCount() float64
- func (p *CheckTable) SetChildren(children ...Plan)
- func (p *CheckTable) SetFields(fields []*ast.ResultField)
- func (p *CheckTable) SetLimit(limit float64)
- func (p *CheckTable) SetParents(pars ...Plan)
- func (p *CheckTable) SetSchema(schema expression.Schema)
- func (p *CheckTable) StartupCost() float64
- func (p *CheckTable) TotalCost() float64
- 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) ReplaceChild(child, newChild Plan) error
- func (p *DDL) ReplaceParent(parent, newPar Plan) error
- func (p *DDL) RowCount() float64
- func (p *DDL) SetChildren(children ...Plan)
- func (p *DDL) SetFields(fields []*ast.ResultField)
- func (p *DDL) SetLimit(limit float64)
- func (p *DDL) SetParents(pars ...Plan)
- func (p *DDL) SetSchema(schema expression.Schema)
- func (p *DDL) StartupCost() float64
- func (p *DDL) TotalCost() float64
- type DataSource
- func (p *DataSource) Convert2PhysicalPlan() (np PhysicalPlan)
- func (p *DataSource) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *DataSource) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Deallocate) ReplaceParent(parent, newPar Plan) error
- func (p *Deallocate) RowCount() float64
- func (p *Deallocate) SetChildren(children ...Plan)
- func (p *Deallocate) SetFields(fields []*ast.ResultField)
- func (p *Deallocate) SetLimit(limit float64)
- func (p *Deallocate) SetParents(pars ...Plan)
- func (p *Deallocate) SetSchema(schema expression.Schema)
- func (p *Deallocate) StartupCost() float64
- func (p *Deallocate) TotalCost() float64
- type Delete
- func (p *Delete) AddChild(child Plan)
- func (p *Delete) AddParent(parent Plan)
- func (p *Delete) Fields() []*ast.ResultField
- func (p *Delete) GetChildByIndex(index int) (parent Plan)
- func (p *Delete) GetChildren() []Plan
- func (p *Delete) GetID() string
- func (p *Delete) GetParentByIndex(index int) (parent Plan)
- func (p *Delete) GetParents() []Plan
- func (p *Delete) GetSchema() expression.Schema
- func (p *Delete) IsCorrelated() bool
- func (p *Delete) ReplaceChild(child, newChild Plan) error
- func (p *Delete) ReplaceParent(parent, newPar Plan) error
- func (p *Delete) RowCount() float64
- func (p *Delete) SetChildren(children ...Plan)
- func (p *Delete) SetFields(fields []*ast.ResultField)
- func (p *Delete) SetLimit(limit float64)
- func (p *Delete) SetParents(pars ...Plan)
- func (p *Delete) SetSchema(schema expression.Schema)
- func (p *Delete) StartupCost() float64
- func (p *Delete) TotalCost() float64
- type Distinct
- func (p *Distinct) Convert2PhysicalPlan() PhysicalPlan
- func (p *Distinct) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *Distinct) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- func (p *Distinct) SetLimit(limit float64)
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Execute) ReplaceParent(parent, newPar Plan) error
- func (p *Execute) RowCount() float64
- func (p *Execute) SetChildren(children ...Plan)
- func (p *Execute) SetFields(fields []*ast.ResultField)
- func (p *Execute) SetLimit(limit float64)
- func (p *Execute) SetParents(pars ...Plan)
- func (p *Execute) SetSchema(schema expression.Schema)
- func (p *Execute) StartupCost() float64
- func (p *Execute) TotalCost() float64
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Explain) ReplaceParent(parent, newPar Plan) error
- func (p *Explain) RowCount() float64
- func (p *Explain) SetChildren(children ...Plan)
- func (p *Explain) SetFields(fields []*ast.ResultField)
- func (p *Explain) SetLimit(limit float64)
- func (p *Explain) SetParents(pars ...Plan)
- func (p *Explain) SetSchema(schema expression.Schema)
- func (p *Explain) StartupCost() float64
- func (p *Explain) TotalCost() float64
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Filter) ReplaceParent(parent, newPar Plan) error
- func (p *Filter) RowCount() float64
- func (p *Filter) SetChildren(children ...Plan)
- func (p *Filter) SetFields(fields []*ast.ResultField)
- func (p *Filter) SetLimit(limit float64)
- func (p *Filter) SetParents(pars ...Plan)
- func (p *Filter) SetSchema(schema expression.Schema)
- func (p *Filter) StartupCost() float64
- func (p *Filter) TotalCost() float64
- type Having
- func (p *Having) AddChild(child Plan)
- func (p *Having) AddParent(parent Plan)
- func (p *Having) Fields() []*ast.ResultField
- func (p *Having) GetChildByIndex(index int) (parent Plan)
- func (p *Having) GetChildren() []Plan
- func (p *Having) GetID() string
- func (p *Having) GetParentByIndex(index int) (parent Plan)
- func (p *Having) GetParents() []Plan
- func (p *Having) GetSchema() expression.Schema
- func (p *Having) IsCorrelated() bool
- func (p *Having) ReplaceChild(child, newChild Plan) error
- func (p *Having) ReplaceParent(parent, newPar Plan) error
- func (p *Having) RowCount() float64
- func (p *Having) SetChildren(children ...Plan)
- func (p *Having) SetFields(fields []*ast.ResultField)
- func (p *Having) SetLimit(limit float64)
- func (p *Having) SetParents(pars ...Plan)
- func (p *Having) SetSchema(schema expression.Schema)
- func (p *Having) StartupCost() float64
- func (p *Having) TotalCost() float64
- type IndexRange
- type IndexScan
- func (p *IndexScan) AddChild(child Plan)
- func (p *IndexScan) AddParent(parent Plan)
- func (p *IndexScan) Fields() []*ast.ResultField
- func (p *IndexScan) GetChildByIndex(index int) (parent Plan)
- func (p *IndexScan) GetChildren() []Plan
- func (p *IndexScan) GetID() string
- func (p *IndexScan) GetParentByIndex(index int) (parent Plan)
- func (p *IndexScan) GetParents() []Plan
- func (p *IndexScan) GetSchema() expression.Schema
- func (p *IndexScan) IsCorrelated() bool
- func (p *IndexScan) ReplaceChild(child, newChild Plan) error
- func (p *IndexScan) ReplaceParent(parent, newPar Plan) error
- func (p *IndexScan) RowCount() float64
- func (p *IndexScan) SetChildren(children ...Plan)
- func (p *IndexScan) SetFields(fields []*ast.ResultField)
- func (p *IndexScan) SetLimit(limit float64)
- func (p *IndexScan) SetParents(pars ...Plan)
- func (p *IndexScan) SetSchema(schema expression.Schema)
- func (p *IndexScan) StartupCost() float64
- func (p *IndexScan) TotalCost() float64
- type Insert
- type Join
- type JoinInner
- func (p *JoinInner) AddChild(child Plan)
- func (p *JoinInner) AddParent(parent Plan)
- func (p *JoinInner) Fields() []*ast.ResultField
- func (p *JoinInner) GetChildByIndex(index int) (parent Plan)
- func (p *JoinInner) GetChildren() []Plan
- func (p *JoinInner) GetID() string
- func (p *JoinInner) GetParentByIndex(index int) (parent Plan)
- func (p *JoinInner) GetParents() []Plan
- func (p *JoinInner) GetSchema() expression.Schema
- func (p *JoinInner) IsCorrelated() bool
- func (p *JoinInner) ReplaceChild(child, newChild Plan) error
- func (p *JoinInner) ReplaceParent(parent, newPar Plan) error
- func (p *JoinInner) RowCount() float64
- func (p *JoinInner) SetChildren(children ...Plan)
- func (p *JoinInner) SetFields(fields []*ast.ResultField)
- func (p *JoinInner) SetLimit(limit float64)
- func (p *JoinInner) SetParents(pars ...Plan)
- func (p *JoinInner) SetSchema(schema expression.Schema)
- func (p *JoinInner) StartupCost() float64
- func (p *JoinInner) String() string
- func (p *JoinInner) TotalCost() float64
- type JoinOuter
- func (p *JoinOuter) AddChild(child Plan)
- func (p *JoinOuter) AddParent(parent Plan)
- func (p *JoinOuter) Fields() []*ast.ResultField
- func (p *JoinOuter) GetChildByIndex(index int) (parent Plan)
- func (p *JoinOuter) GetChildren() []Plan
- func (p *JoinOuter) GetID() string
- func (p *JoinOuter) GetParentByIndex(index int) (parent Plan)
- func (p *JoinOuter) GetParents() []Plan
- func (p *JoinOuter) GetSchema() expression.Schema
- func (p *JoinOuter) IsCorrelated() bool
- func (p *JoinOuter) ReplaceChild(child, newChild Plan) error
- func (p *JoinOuter) ReplaceParent(parent, newPar Plan) error
- func (p *JoinOuter) RowCount() float64
- func (p *JoinOuter) SetChildren(children ...Plan)
- func (p *JoinOuter) SetFields(fields []*ast.ResultField)
- func (p *JoinOuter) SetLimit(limit float64)
- func (p *JoinOuter) SetParents(pars ...Plan)
- func (p *JoinOuter) SetSchema(schema expression.Schema)
- func (p *JoinOuter) StartupCost() float64
- func (p *JoinOuter) TotalCost() float64
- type JoinType
- type Limit
- func (p *Limit) Convert2PhysicalPlan() PhysicalPlan
- func (p *Limit) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *Limit) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- func (p *Limit) SetLimit(limit float64)
- type LogicalPlan
- type MaxOneRow
- type NewSort
- type NewTableDual
- func (p *NewTableDual) Convert2PhysicalPlan() PhysicalPlan
- func (p *NewTableDual) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *NewTableDual) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- type NewUnion
- func (p *NewUnion) Convert2PhysicalPlan() PhysicalPlan
- func (p *NewUnion) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
- func (p *NewUnion) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- type PhysicalApply
- type PhysicalHashJoin
- type PhysicalHashSemiJoin
- type PhysicalIndexScan
- type PhysicalPlan
- type PhysicalTableScan
- func (p *PhysicalTableScan) Convert2PhysicalPlan() PhysicalPlan
- func (p *PhysicalTableScan) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
- func (p *PhysicalTableScan) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Prepare) ReplaceParent(parent, newPar Plan) error
- func (p *Prepare) RowCount() float64
- func (p *Prepare) SetChildren(children ...Plan)
- func (p *Prepare) SetFields(fields []*ast.ResultField)
- func (p *Prepare) SetLimit(limit float64)
- func (p *Prepare) SetParents(pars ...Plan)
- func (p *Prepare) SetSchema(schema expression.Schema)
- func (p *Prepare) StartupCost() float64
- func (p *Prepare) TotalCost() float64
- type Projection
- func (p *Projection) Convert2PhysicalPlan() PhysicalPlan
- 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 SelectFields
- func (p *SelectFields) AddChild(child Plan)
- func (p *SelectFields) AddParent(parent Plan)
- func (p *SelectFields) Fields() []*ast.ResultField
- func (p *SelectFields) GetChildByIndex(index int) (parent Plan)
- func (p *SelectFields) GetChildren() []Plan
- func (p *SelectFields) GetID() string
- func (p *SelectFields) GetParentByIndex(index int) (parent Plan)
- func (p *SelectFields) GetParents() []Plan
- func (p *SelectFields) GetSchema() expression.Schema
- func (p *SelectFields) IsCorrelated() bool
- func (p *SelectFields) ReplaceChild(child, newChild Plan) error
- func (p *SelectFields) ReplaceParent(parent, newPar Plan) error
- func (p *SelectFields) RowCount() float64
- func (p *SelectFields) SetChildren(children ...Plan)
- func (p *SelectFields) SetFields(fields []*ast.ResultField)
- func (p *SelectFields) SetLimit(limit float64)
- func (p *SelectFields) SetParents(pars ...Plan)
- func (p *SelectFields) SetSchema(schema expression.Schema)
- func (p *SelectFields) StartupCost() float64
- func (p *SelectFields) TotalCost() float64
- type SelectLock
- func (p *SelectLock) AddChild(child Plan)
- func (p *SelectLock) AddParent(parent Plan)
- func (p *SelectLock) Fields() []*ast.ResultField
- func (p *SelectLock) GetChildByIndex(index int) (parent Plan)
- func (p *SelectLock) GetChildren() []Plan
- func (p *SelectLock) GetID() string
- func (p *SelectLock) GetParentByIndex(index int) (parent Plan)
- func (p *SelectLock) GetParents() []Plan
- func (p *SelectLock) GetSchema() expression.Schema
- func (p *SelectLock) IsCorrelated() bool
- func (p *SelectLock) ReplaceChild(child, newChild Plan) error
- func (p *SelectLock) ReplaceParent(parent, newPar Plan) error
- func (p *SelectLock) RowCount() float64
- func (p *SelectLock) SetChildren(children ...Plan)
- func (p *SelectLock) SetFields(fields []*ast.ResultField)
- func (p *SelectLock) SetLimit(limit float64)
- func (p *SelectLock) SetParents(pars ...Plan)
- func (p *SelectLock) SetSchema(schema expression.Schema)
- func (p *SelectLock) StartupCost() float64
- func (p *SelectLock) TotalCost() float64
- type Selection
- func (p *Selection) Convert2PhysicalPlan() PhysicalPlan
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Show) ReplaceParent(parent, newPar Plan) error
- func (p *Show) RowCount() float64
- func (p *Show) SetChildren(children ...Plan)
- func (p *Show) SetFields(fields []*ast.ResultField)
- func (p *Show) SetLimit(limit float64)
- func (p *Show) SetParents(pars ...Plan)
- func (p *Show) SetSchema(schema expression.Schema)
- func (p *Show) StartupCost() float64
- func (p *Show) TotalCost() float64
- 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) ReplaceChild(child, newChild Plan) error
- func (p *ShowDDL) ReplaceParent(parent, newPar Plan) error
- func (p *ShowDDL) RowCount() float64
- func (p *ShowDDL) SetChildren(children ...Plan)
- func (p *ShowDDL) SetFields(fields []*ast.ResultField)
- func (p *ShowDDL) SetLimit(limit float64)
- func (p *ShowDDL) SetParents(pars ...Plan)
- func (p *ShowDDL) SetSchema(schema expression.Schema)
- func (p *ShowDDL) StartupCost() float64
- func (p *ShowDDL) TotalCost() float64
- 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) ReplaceChild(child, newChild Plan) error
- func (p *Simple) ReplaceParent(parent, newPar Plan) error
- func (p *Simple) RowCount() float64
- func (p *Simple) SetChildren(children ...Plan)
- func (p *Simple) SetFields(fields []*ast.ResultField)
- func (p *Simple) SetLimit(limit float64)
- func (p *Simple) SetParents(pars ...Plan)
- func (p *Simple) SetSchema(schema expression.Schema)
- func (p *Simple) StartupCost() float64
- func (p *Simple) TotalCost() float64
- type Sort
- func (p *Sort) AddChild(child Plan)
- func (p *Sort) AddParent(parent Plan)
- func (p *Sort) Fields() []*ast.ResultField
- func (p *Sort) GetChildByIndex(index int) (parent Plan)
- func (p *Sort) GetChildren() []Plan
- func (p *Sort) GetID() string
- func (p *Sort) GetParentByIndex(index int) (parent Plan)
- func (p *Sort) GetParents() []Plan
- func (p *Sort) GetSchema() expression.Schema
- func (p *Sort) IsCorrelated() bool
- func (p *Sort) ReplaceChild(child, newChild Plan) error
- func (p *Sort) ReplaceParent(parent, newPar Plan) error
- func (p *Sort) RowCount() float64
- func (p *Sort) SetChildren(children ...Plan)
- func (p *Sort) SetFields(fields []*ast.ResultField)
- func (p *Sort) SetLimit(limit float64)
- func (p *Sort) SetParents(pars ...Plan)
- func (p *Sort) SetSchema(schema expression.Schema)
- func (p *Sort) StartupCost() float64
- func (p *Sort) TotalCost() float64
- type SubQueryBuilder
- type TableDual
- func (p *TableDual) AddChild(child Plan)
- func (p *TableDual) AddParent(parent Plan)
- func (p *TableDual) Fields() []*ast.ResultField
- func (p *TableDual) GetChildByIndex(index int) (parent Plan)
- func (p *TableDual) GetChildren() []Plan
- func (p *TableDual) GetID() string
- func (p *TableDual) GetParentByIndex(index int) (parent Plan)
- func (p *TableDual) GetParents() []Plan
- func (p *TableDual) GetSchema() expression.Schema
- func (p *TableDual) IsCorrelated() bool
- func (p *TableDual) ReplaceChild(child, newChild Plan) error
- func (p *TableDual) ReplaceParent(parent, newPar Plan) error
- func (p *TableDual) RowCount() float64
- func (p *TableDual) SetChildren(children ...Plan)
- func (p *TableDual) SetFields(fields []*ast.ResultField)
- func (p *TableDual) SetLimit(limit float64)
- func (p *TableDual) SetParents(pars ...Plan)
- func (p *TableDual) SetSchema(schema expression.Schema)
- func (p *TableDual) StartupCost() float64
- func (p *TableDual) TotalCost() float64
- type TableRange
- type TableScan
- func (p *TableScan) AddChild(child Plan)
- func (p *TableScan) AddParent(parent Plan)
- func (p *TableScan) Fields() []*ast.ResultField
- func (p *TableScan) GetChildByIndex(index int) (parent Plan)
- func (p *TableScan) GetChildren() []Plan
- func (p *TableScan) GetID() string
- func (p *TableScan) GetParentByIndex(index int) (parent Plan)
- func (p *TableScan) GetParents() []Plan
- func (p *TableScan) GetSchema() expression.Schema
- func (p *TableScan) IsCorrelated() bool
- func (p *TableScan) ReplaceChild(child, newChild Plan) error
- func (p *TableScan) ReplaceParent(parent, newPar Plan) error
- func (p *TableScan) RowCount() float64
- func (p *TableScan) SetChildren(children ...Plan)
- func (p *TableScan) SetFields(fields []*ast.ResultField)
- func (p *TableScan) SetLimit(limit float64)
- func (p *TableScan) SetParents(pars ...Plan)
- func (p *TableScan) SetSchema(schema expression.Schema)
- func (p *TableScan) StartupCost() float64
- func (p *TableScan) TotalCost() float64
- type Trim
- type Union
- func (p *Union) AddChild(child Plan)
- func (p *Union) AddParent(parent Plan)
- func (p *Union) Fields() []*ast.ResultField
- func (p *Union) GetChildByIndex(index int) (parent Plan)
- func (p *Union) GetChildren() []Plan
- func (p *Union) GetID() string
- func (p *Union) GetParentByIndex(index int) (parent Plan)
- func (p *Union) GetParents() []Plan
- func (p *Union) GetSchema() expression.Schema
- func (p *Union) IsCorrelated() bool
- func (p *Union) ReplaceChild(child, newChild Plan) error
- func (p *Union) ReplaceParent(parent, newPar Plan) error
- func (p *Union) RowCount() float64
- func (p *Union) SetChildren(children ...Plan)
- func (p *Union) SetFields(fields []*ast.ResultField)
- func (p *Union) SetLimit(limit float64)
- func (p *Union) SetParents(pars ...Plan)
- func (p *Union) SetSchema(schema expression.Schema)
- func (p *Union) StartupCost() float64
- func (p *Union) TotalCost() float64
- type Update
- func (p *Update) AddChild(child Plan)
- func (p *Update) AddParent(parent Plan)
- func (p *Update) Fields() []*ast.ResultField
- func (p *Update) GetChildByIndex(index int) (parent Plan)
- func (p *Update) GetChildren() []Plan
- func (p *Update) GetID() string
- func (p *Update) GetParentByIndex(index int) (parent Plan)
- func (p *Update) GetParents() []Plan
- func (p *Update) GetSchema() expression.Schema
- func (p *Update) IsCorrelated() bool
- func (p *Update) ReplaceChild(child, newChild Plan) error
- func (p *Update) ReplaceParent(parent, newPar Plan) error
- func (p *Update) RowCount() float64
- func (p *Update) SetChildren(children ...Plan)
- func (p *Update) SetFields(fields []*ast.ResultField)
- func (p *Update) SetLimit(limit float64)
- func (p *Update) SetParents(pars ...Plan)
- func (p *Update) SetSchema(schema expression.Schema)
- func (p *Update) StartupCost() float64
- func (p *Update) TotalCost() float64
Constants ¶
const ( FullRangeCount = 10000 HalfRangeCount = 4000 MiddleRangeCount = 100 RowCost = 1.0 IndexCost = 1.1 SortCost = 2.0 FilterRate = 0.5 )
Pre-defined cost factors.
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" )
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 UseNewPlanner = false
UseNewPlanner means if use the new planner.
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.
Types ¶
type Aggregate ¶
type Aggregate struct { AggFuncs []*ast.AggregateFuncExpr GroupByItems []*ast.ByItem // contains filtered or unexported fields }
Aggregate represents a select fields plan.
func (*Aggregate) AddChild ¶
func (p *Aggregate) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Aggregate) AddParent ¶
func (p *Aggregate) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Aggregate) Fields ¶
func (p *Aggregate) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Aggregate) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Aggregate) GetChildren ¶
func (p *Aggregate) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Aggregate) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Aggregate) GetParents ¶
func (p *Aggregate) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Aggregate) GetSchema ¶
func (p *Aggregate) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Aggregate) IsCorrelated ¶
func (p *Aggregate) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Aggregate) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Aggregate) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Aggregate) RowCount ¶
func (p *Aggregate) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Aggregate) SetChildren ¶
func (p *Aggregate) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Aggregate) SetFields ¶
func (p *Aggregate) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Aggregate) SetParents ¶
func (p *Aggregate) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Aggregate) SetSchema ¶
func (p *Aggregate) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*Aggregate) StartupCost ¶
func (p *Aggregate) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type AggregateFuncExtractor ¶
type AggregateFuncExtractor struct {
// 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) Convert2PhysicalPlan ¶
func (p *Aggregation) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
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 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) Convert2PhysicalPlan ¶
func (p *Apply) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*CheckTable) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*CheckTable) RowCount ¶
func (p *CheckTable) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *CheckTable) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*CheckTable) StartupCost ¶
func (p *CheckTable) StartupCost() float64
StartupCost implements Plan StartupCost 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*DDL) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*DDL) RowCount ¶
func (p *DDL) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *DDL) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*DDL) StartupCost ¶
func (p *DDL) StartupCost() float64
StartupCost implements Plan StartupCost 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) Convert2PhysicalPlan ¶
func (p *DataSource) Convert2PhysicalPlan() (np PhysicalPlan)
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Deallocate) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Deallocate) RowCount ¶
func (p *Deallocate) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *Deallocate) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*Deallocate) StartupCost ¶
func (p *Deallocate) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Delete ¶
type Delete struct { SelectPlan Plan Tables []*ast.TableName IsMultiTable bool // contains filtered or unexported fields }
Delete represents a delete plan.
func (*Delete) AddChild ¶
func (p *Delete) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Delete) AddParent ¶
func (p *Delete) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Delete) Fields ¶
func (p *Delete) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Delete) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Delete) GetChildren ¶
func (p *Delete) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Delete) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Delete) GetParents ¶
func (p *Delete) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Delete) GetSchema ¶
func (p *Delete) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Delete) IsCorrelated ¶
func (p *Delete) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Delete) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Delete) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Delete) RowCount ¶
func (p *Delete) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Delete) SetChildren ¶
func (p *Delete) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Delete) SetFields ¶
func (p *Delete) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Delete) SetLimit ¶
func (p *Delete) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*Delete) SetParents ¶
func (p *Delete) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Delete) SetSchema ¶
func (p *Delete) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*Delete) StartupCost ¶
func (p *Delete) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Distinct ¶
type Distinct struct {
// contains filtered or unexported fields
}
Distinct represents Distinct plan.
func (*Distinct) Convert2PhysicalPlan ¶
func (p *Distinct) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Execute) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Execute) RowCount ¶
func (p *Execute) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *Execute) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*Execute) StartupCost ¶
func (p *Execute) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Exists ¶
type Exists struct {
// contains filtered or unexported fields
}
Exists checks if a query returns result.
func (*Exists) Convert2PhysicalPlan ¶
func (p *Exists) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Explain) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Explain) RowCount ¶
func (p *Explain) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *Explain) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*Explain) StartupCost ¶
func (p *Explain) StartupCost() float64
StartupCost implements Plan StartupCost 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Filter) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Filter) RowCount ¶
func (p *Filter) RowCount() float64
RowCount implements Plan RowCount interface.
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.
func (*Filter) StartupCost ¶
func (p *Filter) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Having ¶
type Having 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 }
Having represents a having plan. The having plan should after aggregate plan.
func (*Having) AddChild ¶
func (p *Having) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Having) AddParent ¶
func (p *Having) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Having) Fields ¶
func (p *Having) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Having) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Having) GetChildren ¶
func (p *Having) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Having) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Having) GetParents ¶
func (p *Having) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Having) GetSchema ¶
func (p *Having) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Having) IsCorrelated ¶
func (p *Having) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Having) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Having) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Having) RowCount ¶
func (p *Having) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Having) SetChildren ¶
func (p *Having) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Having) SetFields ¶
func (p *Having) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Having) SetParents ¶
func (p *Having) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Having) SetSchema ¶
func (p *Having) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*Having) StartupCost ¶
func (p *Having) StartupCost() float64
StartupCost implements Plan StartupCost 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 IndexScan ¶
type IndexScan struct { // The index used. Index *model.IndexInfo // The table to lookup. Table *model.TableInfo // Ordered and non-overlapping ranges to be scanned. Ranges []*IndexRange // Desc indicates whether the index should be scanned in descending order. Desc bool // RefAccess indicates it references a previous joined table, used in explain. RefAccess bool // AccessConditions can be used to build index range. AccessConditions []ast.ExprNode // Number of leading equal access condition. // The offset of each equal condition correspond to the offset of index column. // For example, an index has column (a, b, c), condition is 'a = 0 and b = 0 and c > 0' // AccessEqualCount would be 2. AccessEqualCount int // FilterConditions can be used to filter result. FilterConditions []ast.ExprNode // OutOfOrder indicates if the index scan can return out of order. OutOfOrder bool // NoLimit indicates that this plan need fetch all the rows. NoLimit bool // TableName is used to distinguish the same table selected multiple times in different place, // like 'select * from t where exists(select 1 from t as x where t.c < x.c)' TableName *ast.TableName TableAsName *model.CIStr LimitCount *int64 // contains filtered or unexported fields }
IndexScan represents an index scan plan.
func (*IndexScan) AddChild ¶
func (p *IndexScan) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*IndexScan) AddParent ¶
func (p *IndexScan) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*IndexScan) Fields ¶
func (p *IndexScan) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*IndexScan) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*IndexScan) GetChildren ¶
func (p *IndexScan) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*IndexScan) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*IndexScan) GetParents ¶
func (p *IndexScan) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*IndexScan) GetSchema ¶
func (p *IndexScan) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*IndexScan) IsCorrelated ¶
func (p *IndexScan) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*IndexScan) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*IndexScan) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*IndexScan) RowCount ¶
func (p *IndexScan) RowCount() float64
RowCount implements Plan RowCount interface.
func (*IndexScan) SetChildren ¶
func (p *IndexScan) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*IndexScan) SetFields ¶
func (p *IndexScan) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*IndexScan) SetLimit ¶
func (p *IndexScan) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*IndexScan) SetParents ¶
func (p *IndexScan) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*IndexScan) SetSchema ¶
func (p *IndexScan) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*IndexScan) StartupCost ¶
func (p *IndexScan) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Insert ¶
type Insert struct { Table *ast.TableRefsClause Columns []*ast.ColumnName Lists [][]ast.ExprNode Setlist []*ast.Assignment OnDuplicate []*ast.Assignment SelectPlan Plan IsReplace bool Priority int // contains filtered or unexported fields }
Insert represents an insert plan.
func (*Insert) Convert2PhysicalPlan ¶
func (p *Insert) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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) Convert2PhysicalPlan ¶
func (p *Join) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
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 JoinInner ¶
type JoinInner struct { Inners []Plan Conditions []ast.ExprNode // contains filtered or unexported fields }
JoinInner represents inner join plan.
func (*JoinInner) AddChild ¶
func (p *JoinInner) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*JoinInner) AddParent ¶
func (p *JoinInner) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*JoinInner) Fields ¶
func (p *JoinInner) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*JoinInner) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*JoinInner) GetChildren ¶
func (p *JoinInner) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*JoinInner) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*JoinInner) GetParents ¶
func (p *JoinInner) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*JoinInner) GetSchema ¶
func (p *JoinInner) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*JoinInner) IsCorrelated ¶
func (p *JoinInner) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*JoinInner) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*JoinInner) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*JoinInner) RowCount ¶
func (p *JoinInner) RowCount() float64
RowCount implements Plan RowCount interface.
func (*JoinInner) SetChildren ¶
func (p *JoinInner) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*JoinInner) SetFields ¶
func (p *JoinInner) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*JoinInner) SetLimit ¶
func (p *JoinInner) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*JoinInner) SetParents ¶
func (p *JoinInner) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*JoinInner) SetSchema ¶
func (p *JoinInner) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*JoinInner) StartupCost ¶
func (p *JoinInner) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type JoinOuter ¶
JoinOuter represents outer join plan.
func (*JoinOuter) AddChild ¶
func (p *JoinOuter) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*JoinOuter) AddParent ¶
func (p *JoinOuter) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*JoinOuter) Fields ¶
func (p *JoinOuter) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*JoinOuter) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*JoinOuter) GetChildren ¶
func (p *JoinOuter) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*JoinOuter) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*JoinOuter) GetParents ¶
func (p *JoinOuter) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*JoinOuter) GetSchema ¶
func (p *JoinOuter) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*JoinOuter) IsCorrelated ¶
func (p *JoinOuter) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*JoinOuter) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*JoinOuter) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*JoinOuter) RowCount ¶
func (p *JoinOuter) RowCount() float64
RowCount implements Plan RowCount interface.
func (*JoinOuter) SetChildren ¶
func (p *JoinOuter) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*JoinOuter) SetFields ¶
func (p *JoinOuter) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*JoinOuter) SetLimit ¶
func (p *JoinOuter) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*JoinOuter) SetParents ¶
func (p *JoinOuter) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*JoinOuter) SetSchema ¶
func (p *JoinOuter) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*JoinOuter) StartupCost ¶
func (p *JoinOuter) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type JoinType ¶
type JoinType int
JoinType contains CrossJoin, InnerJoin, LeftOuterJoin, RightOuterJoin, FullOuterJoin, SemiJoin.
const ( // CrossJoin means Cartesian Product, but not used now. CrossJoin JoinType = iota // InnerJoin means inner join. InnerJoin // 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) Convert2PhysicalPlan ¶
func (p *Limit) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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 LogicalPlan ¶
type LogicalPlan interface { Plan // PredicatePushDown push down predicates in where/on/having clause as deeply as possible. // It will accept a predicate that is a expression slice, and return the expressions that can't be pushed. // Because it may change the root when exists having clause, we need return a plan that representing a new root. PredicatePushDown([]expression.Expression) ([]expression.Expression, LogicalPlan, error) // PruneColumnsAndResolveIndices prunes unused columns and resolves index for columns. // This function returns a column slice representing columns from outer env and an error. // We need return outer columns, because Apply plan will prune inner Planner and it will know // how many columns referenced by inner plan exactly. PruneColumnsAndResolveIndices([]*expression.Column) ([]*expression.Column, error) // Convert2PhysicalPlan converts logical plan to physical plan. Convert2PhysicalPlan() PhysicalPlan }
LogicalPlan is a tree of logical operators. We can do a lot of logical optimization to it, like predicate push down 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) Convert2PhysicalPlan ¶
func (p *MaxOneRow) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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 NewSort ¶
type NewSort struct { ByItems []*ByItems ExecLimit *Limit // contains filtered or unexported fields }
NewSort stands for the order by plan.
func (*NewSort) Convert2PhysicalPlan ¶
func (p *NewSort) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
func (*NewSort) PredicatePushDown ¶
func (p *NewSort) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*NewSort) PruneColumnsAndResolveIndices ¶
func (p *NewSort) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface.
type NewTableDual ¶
type NewTableDual struct {
// contains filtered or unexported fields
}
NewTableDual represents a dual table plan.
func (*NewTableDual) Convert2PhysicalPlan ¶
func (p *NewTableDual) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
func (*NewTableDual) PredicatePushDown ¶
func (p *NewTableDual) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*NewTableDual) PruneColumnsAndResolveIndices ¶
func (p *NewTableDual) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices interface.
type NewUnion ¶
type NewUnion struct { Selects []LogicalPlan // contains filtered or unexported fields }
NewUnion represents Union plan.
func (*NewUnion) Convert2PhysicalPlan ¶
func (p *NewUnion) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan interface.
func (*NewUnion) PredicatePushDown ¶
func (p *NewUnion) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan, err error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*NewUnion) PruneColumnsAndResolveIndices ¶
func (p *NewUnion) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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.
type PhysicalHashJoin ¶
type PhysicalHashJoin struct { JoinType JoinType EqualConditions []*expression.ScalarFunction LeftConditions []expression.Expression RightConditions []expression.Expression OtherConditions []expression.Expression // contains filtered or unexported fields }
PhysicalHashJoin represents hash join for inner/ outer join.
type PhysicalHashSemiJoin ¶
type PhysicalHashSemiJoin struct { WithAux 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.
type PhysicalIndexScan ¶
type PhysicalIndexScan struct { Table *model.TableInfo Index *model.IndexInfo Ranges []*IndexRange Columns []*model.ColumnInfo DBName *model.CIStr Desc bool OutOfOrder bool AccessCondition []expression.Expression TableAsName *model.CIStr LimitCount *int64 // contains filtered or unexported fields }
PhysicalIndexScan represents an index scan plan.
type PhysicalPlan ¶
type PhysicalPlan interface { Plan }
PhysicalPlan is a tree of 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 LimitCount *int64 // contains filtered or unexported fields }
PhysicalTableScan represents a table scan plan.
func (*PhysicalTableScan) Convert2PhysicalPlan ¶
func (p *PhysicalTableScan) Convert2PhysicalPlan() PhysicalPlan
func (*PhysicalTableScan) PredicatePushDown ¶
func (p *PhysicalTableScan) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*PhysicalTableScan) PruneColumnsAndResolveIndices ¶
func (p *PhysicalTableScan) PruneColumnsAndResolveIndices(parentUsedCols []*expression.Column) ([]*expression.Column, error)
PruneColumnsAndResolveIndices implements LogicalPlan PruneColumnsAndResolveIndices 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) // The cost before returning fhe first row. StartupCost() float64 // The cost after returning all the rows. TotalCost() float64 // The expected row count. RowCount() float64 // SetLimit is used to push limit to upstream to estimate the cost. SetLimit(limit float64) // AddParent means append a parent for plan. AddParent(parent Plan) // AddChild means append a child for plan. AddChild(children Plan) // ReplaceParent means replace a parent with another one. ReplaceParent(parent, newPar Plan) error // ReplaceChild means replace a child with another one. ReplaceChild(children, newChild Plan) error // Retrieve parent by index. GetParentByIndex(index int) Plan // Retrieve 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 ID. GetID() string IsCorrelated() bool // SetParents sets parents for plan. SetParents(...Plan) // SetParents sets children for plan. SetChildren(...Plan) }
Plan is a description of an execution flow. It is created from ast.Node first, then optimized by optimizer, then used by executor to create a Cursor which executes the statement.
func BuildPlan ¶
func BuildPlan(node ast.Node, sb SubQueryBuilder) (Plan, error)
BuildPlan builds a plan from a node. It returns ErrUnsupportedType if ast.Node type is not supported yet.
func Optimize ¶
func Optimize(ctx context.Context, node ast.Node, sb SubQueryBuilder, 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Prepare) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Prepare) RowCount ¶
func (p *Prepare) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *Prepare) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*Prepare) StartupCost ¶
func (p *Prepare) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Projection ¶
type Projection struct { Exprs []expression.Expression // contains filtered or unexported fields }
Projection represents a select fields plan.
func (*Projection) Convert2PhysicalPlan ¶
func (p *Projection) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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 SelectFields ¶
type SelectFields struct {
// contains filtered or unexported fields
}
SelectFields represents a select fields plan.
func (*SelectFields) AddChild ¶
func (p *SelectFields) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*SelectFields) AddParent ¶
func (p *SelectFields) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*SelectFields) Fields ¶
func (p *SelectFields) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*SelectFields) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*SelectFields) GetChildren ¶
func (p *SelectFields) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*SelectFields) GetID ¶
func (p *SelectFields) GetID() string
GetID implements Plan GetID interface.
func (*SelectFields) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*SelectFields) GetParents ¶
func (p *SelectFields) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*SelectFields) GetSchema ¶
func (p *SelectFields) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*SelectFields) IsCorrelated ¶
func (p *SelectFields) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*SelectFields) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*SelectFields) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*SelectFields) RowCount ¶
func (p *SelectFields) RowCount() float64
RowCount implements Plan RowCount interface.
func (*SelectFields) SetChildren ¶
func (p *SelectFields) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*SelectFields) SetFields ¶
func (p *SelectFields) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*SelectFields) SetLimit ¶
func (p *SelectFields) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*SelectFields) SetParents ¶
func (p *SelectFields) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*SelectFields) SetSchema ¶
func (p *SelectFields) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*SelectFields) StartupCost ¶
func (p *SelectFields) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type SelectLock ¶
type SelectLock struct { Lock ast.SelectLockType // contains filtered or unexported fields }
SelectLock represents a select lock plan.
func (*SelectLock) AddChild ¶
func (p *SelectLock) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*SelectLock) AddParent ¶
func (p *SelectLock) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*SelectLock) Fields ¶
func (p *SelectLock) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*SelectLock) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*SelectLock) GetChildren ¶
func (p *SelectLock) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*SelectLock) GetID ¶
func (p *SelectLock) GetID() string
GetID implements Plan GetID interface.
func (*SelectLock) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*SelectLock) GetParents ¶
func (p *SelectLock) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*SelectLock) GetSchema ¶
func (p *SelectLock) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*SelectLock) IsCorrelated ¶
func (p *SelectLock) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*SelectLock) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*SelectLock) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*SelectLock) RowCount ¶
func (p *SelectLock) RowCount() float64
RowCount implements Plan RowCount interface.
func (*SelectLock) SetChildren ¶
func (p *SelectLock) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*SelectLock) SetFields ¶
func (p *SelectLock) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*SelectLock) SetLimit ¶
func (p *SelectLock) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*SelectLock) SetParents ¶
func (p *SelectLock) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*SelectLock) SetSchema ¶
func (p *SelectLock) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*SelectLock) StartupCost ¶
func (p *SelectLock) StartupCost() float64
StartupCost implements Plan StartupCost 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) Convert2PhysicalPlan ¶
func (p *Selection) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Show) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Show) RowCount ¶
func (p *Show) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *Show) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*Show) StartupCost ¶
func (p *Show) StartupCost() float64
StartupCost implements Plan StartupCost 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*ShowDDL) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*ShowDDL) RowCount ¶
func (p *ShowDDL) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *ShowDDL) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*ShowDDL) StartupCost ¶
func (p *ShowDDL) StartupCost() float64
StartupCost implements Plan StartupCost 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) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Simple) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Simple) RowCount ¶
func (p *Simple) RowCount() float64
RowCount implements Plan RowCount interface.
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) SetLimit ¶
func (p *Simple) SetLimit(limit float64)
SetLimit implements Plan SetLimit 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.
func (*Simple) StartupCost ¶
func (p *Simple) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Sort ¶
type Sort struct { ByItems []*ast.ByItem ExecLimit *Limit // contains filtered or unexported fields }
Sort represents a sorting plan.
func (*Sort) AddChild ¶
func (p *Sort) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Sort) AddParent ¶
func (p *Sort) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Sort) Fields ¶
func (p *Sort) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Sort) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Sort) GetChildren ¶
func (p *Sort) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Sort) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Sort) GetParents ¶
func (p *Sort) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Sort) GetSchema ¶
func (p *Sort) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Sort) IsCorrelated ¶
func (p *Sort) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Sort) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Sort) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Sort) RowCount ¶
func (p *Sort) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Sort) SetChildren ¶
func (p *Sort) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Sort) SetFields ¶
func (p *Sort) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Sort) SetLimit ¶
SetLimit implements Plan SetLimit interface. It set the Src limit only if it is bypassed. Bypass has to be determined before this get called.
func (*Sort) SetParents ¶
func (p *Sort) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Sort) SetSchema ¶
func (p *Sort) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*Sort) StartupCost ¶
func (p *Sort) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type SubQueryBuilder ¶
type SubQueryBuilder interface {
Build(p Plan) ast.SubqueryExec
}
SubQueryBuilder is the interface for building SubQuery executor.
type TableDual ¶
type TableDual struct { HasAgg bool // FilterConditions can be used to filter result. FilterConditions []ast.ExprNode // contains filtered or unexported fields }
TableDual represents a dual table plan.
func (*TableDual) AddChild ¶
func (p *TableDual) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*TableDual) AddParent ¶
func (p *TableDual) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*TableDual) Fields ¶
func (p *TableDual) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*TableDual) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*TableDual) GetChildren ¶
func (p *TableDual) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*TableDual) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*TableDual) GetParents ¶
func (p *TableDual) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*TableDual) GetSchema ¶
func (p *TableDual) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*TableDual) IsCorrelated ¶
func (p *TableDual) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*TableDual) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*TableDual) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*TableDual) RowCount ¶
func (p *TableDual) RowCount() float64
RowCount implements Plan RowCount interface.
func (*TableDual) SetChildren ¶
func (p *TableDual) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*TableDual) SetFields ¶
func (p *TableDual) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*TableDual) SetLimit ¶
func (p *TableDual) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*TableDual) SetParents ¶
func (p *TableDual) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*TableDual) SetSchema ¶
func (p *TableDual) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*TableDual) StartupCost ¶
func (p *TableDual) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type TableRange ¶
TableRange represents a range of row handle.
type TableScan ¶
type TableScan struct { Table *model.TableInfo Desc bool Ranges []TableRange // RefAccess indicates it references a previous joined table, used in explain. RefAccess bool // AccessConditions can be used to build index range. AccessConditions []ast.ExprNode // FilterConditions can be used to filter result. FilterConditions []ast.ExprNode // TableName is used to distinguish the same table selected multiple times in different place, // like 'select * from t where exists(select 1 from t as x where t.c < x.c)' TableName *ast.TableName TableAsName *model.CIStr LimitCount *int64 // contains filtered or unexported fields }
TableScan represents a table scan plan.
func (*TableScan) AddChild ¶
func (p *TableScan) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*TableScan) AddParent ¶
func (p *TableScan) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*TableScan) Fields ¶
func (p *TableScan) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*TableScan) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*TableScan) GetChildren ¶
func (p *TableScan) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*TableScan) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*TableScan) GetParents ¶
func (p *TableScan) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*TableScan) GetSchema ¶
func (p *TableScan) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*TableScan) IsCorrelated ¶
func (p *TableScan) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*TableScan) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*TableScan) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*TableScan) RowCount ¶
func (p *TableScan) RowCount() float64
RowCount implements Plan RowCount interface.
func (*TableScan) SetChildren ¶
func (p *TableScan) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*TableScan) SetFields ¶
func (p *TableScan) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*TableScan) SetLimit ¶
func (p *TableScan) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*TableScan) SetParents ¶
func (p *TableScan) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*TableScan) SetSchema ¶
func (p *TableScan) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*TableScan) StartupCost ¶
func (p *TableScan) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Trim ¶
type Trim struct {
// contains filtered or unexported fields
}
Trim trims child's rows.
func (*Trim) Convert2PhysicalPlan ¶
func (p *Trim) Convert2PhysicalPlan() PhysicalPlan
Convert2PhysicalPlan implements LogicalPlan Convert2PhysicalPlan 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 { Selects []Plan // contains filtered or unexported fields }
Union represents Union plan.
func (*Union) AddChild ¶
func (p *Union) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Union) AddParent ¶
func (p *Union) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Union) Fields ¶
func (p *Union) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Union) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Union) GetChildren ¶
func (p *Union) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Union) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Union) GetParents ¶
func (p *Union) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Union) GetSchema ¶
func (p *Union) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Union) IsCorrelated ¶
func (p *Union) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Union) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Union) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Union) RowCount ¶
func (p *Union) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Union) SetChildren ¶
func (p *Union) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Union) SetFields ¶
func (p *Union) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Union) SetLimit ¶
func (p *Union) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*Union) SetParents ¶
func (p *Union) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Union) SetSchema ¶
func (p *Union) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*Union) StartupCost ¶
func (p *Union) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Update ¶
type Update struct { OrderedList []*ast.Assignment // OrderedList has the same offset as TablePlan's result fields. SelectPlan Plan // contains filtered or unexported fields }
Update represents an update plan.
func (*Update) AddChild ¶
func (p *Update) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Update) AddParent ¶
func (p *Update) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Update) Fields ¶
func (p *Update) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Update) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Update) GetChildren ¶
func (p *Update) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Update) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Update) GetParents ¶
func (p *Update) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Update) GetSchema ¶
func (p *Update) GetSchema() expression.Schema
GetSchema implements Plan GetSchema interface.
func (*Update) IsCorrelated ¶
func (p *Update) IsCorrelated() bool
IsCorrelated implements Plan IsCorrelated interface.
func (*Update) ReplaceChild ¶
ReplaceChild means replace a child with another one.
func (*Update) ReplaceParent ¶
ReplaceParent means replace a parent for another one.
func (*Update) RowCount ¶
func (p *Update) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Update) SetChildren ¶
func (p *Update) SetChildren(children ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Update) SetFields ¶
func (p *Update) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Update) SetLimit ¶
func (p *Update) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*Update) SetParents ¶
func (p *Update) SetParents(pars ...Plan)
RemoveAllParents implements Plan RemoveAllParents interface.
func (*Update) SetSchema ¶
func (p *Update) SetSchema(schema expression.Schema)
SetSchema implements Plan SetSchema interface.
func (*Update) StartupCost ¶
func (p *Update) StartupCost() float64
StartupCost implements Plan StartupCost interface.
Source Files ¶
- column_pruning.go
- cost.go
- expression_rewriter.go
- filterrate.go
- logic.go
- logical_plan_builder.go
- logical_plans.go
- optimizer.go
- physical_plan_builder.go
- physical_plans.go
- plan.go
- planbuilder.go
- planbuilder_join.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. |