Documentation ¶
Index ¶
- Constants
- Variables
- func EstimateCost(p Plan) float64
- func Refine(p Plan) error
- func ToString(p Plan) string
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Aggregate) GetParents() []Plan
- func (p *Aggregate) RowCount() float64
- func (p *Aggregate) SetFields(fields []*ast.ResultField)
- func (p *Aggregate) SetLimit(limit float64)
- func (p *Aggregate) StartupCost() float64
- func (p *Aggregate) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *CheckTable) GetParents() []Plan
- func (p *CheckTable) RowCount() float64
- func (p *CheckTable) SetFields(fields []*ast.ResultField)
- func (p *CheckTable) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *DDL) GetParents() []Plan
- func (p *DDL) RowCount() float64
- func (p *DDL) SetFields(fields []*ast.ResultField)
- func (p *DDL) SetLimit(limit float64)
- func (p *DDL) StartupCost() float64
- func (p *DDL) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Deallocate) GetParents() []Plan
- func (p *Deallocate) RowCount() float64
- func (p *Deallocate) SetFields(fields []*ast.ResultField)
- func (p *Deallocate) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Delete) GetParents() []Plan
- func (p *Delete) RowCount() float64
- func (p *Delete) SetFields(fields []*ast.ResultField)
- func (p *Delete) SetLimit(limit float64)
- func (p *Delete) StartupCost() float64
- func (p *Delete) TotalCost() float64
- type Distinct
- func (p *Distinct) AddChild(child Plan)
- func (p *Distinct) AddParent(parent Plan)
- func (p *Distinct) Fields() []*ast.ResultField
- func (p *Distinct) GetChildByIndex(index int) (parent Plan)
- func (p *Distinct) GetChildren() []Plan
- func (p *Distinct) GetParentByIndex(index int) (parent Plan)
- func (p *Distinct) GetParents() []Plan
- func (p *Distinct) RowCount() float64
- func (p *Distinct) SetFields(fields []*ast.ResultField)
- func (p *Distinct) SetLimit(limit float64)
- func (p *Distinct) StartupCost() float64
- func (p *Distinct) TotalCost() 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) GetParentByIndex(index int) (parent Plan)
- func (p *Execute) GetParents() []Plan
- func (p *Execute) RowCount() float64
- func (p *Execute) SetFields(fields []*ast.ResultField)
- func (p *Execute) SetLimit(limit float64)
- func (p *Execute) StartupCost() float64
- func (p *Execute) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Explain) GetParents() []Plan
- func (p *Explain) RowCount() float64
- func (p *Explain) SetFields(fields []*ast.ResultField)
- func (p *Explain) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Filter) GetParents() []Plan
- func (p *Filter) RowCount() float64
- func (p *Filter) SetFields(fields []*ast.ResultField)
- func (p *Filter) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Having) GetParents() []Plan
- func (p *Having) RowCount() float64
- func (p *Having) SetFields(fields []*ast.ResultField)
- func (p *Having) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *IndexScan) GetParents() []Plan
- func (p *IndexScan) RowCount() float64
- func (p *IndexScan) SetFields(fields []*ast.ResultField)
- func (p *IndexScan) SetLimit(limit float64)
- func (p *IndexScan) StartupCost() float64
- func (p *IndexScan) TotalCost() float64
- type Insert
- func (p *Insert) AddChild(child Plan)
- func (p *Insert) AddParent(parent Plan)
- func (p *Insert) Fields() []*ast.ResultField
- func (p *Insert) GetChildByIndex(index int) (parent Plan)
- func (p *Insert) GetChildren() []Plan
- func (p *Insert) GetParentByIndex(index int) (parent Plan)
- func (p *Insert) GetParents() []Plan
- func (p *Insert) RowCount() float64
- func (p *Insert) SetFields(fields []*ast.ResultField)
- func (p *Insert) SetLimit(limit float64)
- func (p *Insert) StartupCost() float64
- func (p *Insert) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *JoinInner) GetParents() []Plan
- func (p *JoinInner) RowCount() float64
- func (p *JoinInner) SetFields(fields []*ast.ResultField)
- func (p *JoinInner) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *JoinOuter) GetParents() []Plan
- func (p *JoinOuter) RowCount() float64
- func (p *JoinOuter) SetFields(fields []*ast.ResultField)
- func (p *JoinOuter) SetLimit(limit float64)
- func (p *JoinOuter) StartupCost() float64
- func (p *JoinOuter) TotalCost() float64
- type Limit
- func (p *Limit) AddChild(child Plan)
- func (p *Limit) AddParent(parent Plan)
- func (p *Limit) Fields() []*ast.ResultField
- func (p *Limit) GetChildByIndex(index int) (parent Plan)
- func (p *Limit) GetChildren() []Plan
- func (p *Limit) GetParentByIndex(index int) (parent Plan)
- func (p *Limit) GetParents() []Plan
- func (p *Limit) RowCount() float64
- func (p *Limit) SetFields(fields []*ast.ResultField)
- func (p *Limit) SetLimit(limit float64)
- func (p *Limit) StartupCost() float64
- func (p *Limit) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Prepare) GetParents() []Plan
- func (p *Prepare) RowCount() float64
- func (p *Prepare) SetFields(fields []*ast.ResultField)
- func (p *Prepare) SetLimit(limit float64)
- func (p *Prepare) StartupCost() float64
- func (p *Prepare) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *SelectFields) GetParents() []Plan
- func (p *SelectFields) RowCount() float64
- func (p *SelectFields) SetFields(fields []*ast.ResultField)
- func (p *SelectFields) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *SelectLock) GetParents() []Plan
- func (p *SelectLock) RowCount() float64
- func (p *SelectLock) SetFields(fields []*ast.ResultField)
- func (p *SelectLock) SetLimit(limit float64)
- func (p *SelectLock) StartupCost() float64
- func (p *SelectLock) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Show) GetParents() []Plan
- func (p *Show) RowCount() float64
- func (p *Show) SetFields(fields []*ast.ResultField)
- func (p *Show) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *ShowDDL) GetParents() []Plan
- func (p *ShowDDL) RowCount() float64
- func (p *ShowDDL) SetFields(fields []*ast.ResultField)
- func (p *ShowDDL) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Simple) GetParents() []Plan
- func (p *Simple) RowCount() float64
- func (p *Simple) SetFields(fields []*ast.ResultField)
- func (p *Simple) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Sort) GetParents() []Plan
- func (p *Sort) RowCount() float64
- func (p *Sort) SetFields(fields []*ast.ResultField)
- func (p *Sort) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *TableDual) GetParents() []Plan
- func (p *TableDual) RowCount() float64
- func (p *TableDual) SetFields(fields []*ast.ResultField)
- func (p *TableDual) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *TableScan) GetParents() []Plan
- func (p *TableScan) RowCount() float64
- func (p *TableScan) SetFields(fields []*ast.ResultField)
- func (p *TableScan) SetLimit(limit float64)
- func (p *TableScan) StartupCost() float64
- func (p *TableScan) TotalCost() float64
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Union) GetParents() []Plan
- func (p *Union) RowCount() float64
- func (p *Union) SetFields(fields []*ast.ResultField)
- func (p *Union) SetLimit(limit float64)
- 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) GetParentByIndex(index int) (parent Plan)
- func (p *Update) GetParents() []Plan
- func (p *Update) RowCount() float64
- func (p *Update) SetFields(fields []*ast.ResultField)
- func (p *Update) SetLimit(limit float64)
- 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 (
CodeUnsupportedType terror.ErrCode = 1
)
Error codes.
Variables ¶
var (
ErrUnsupportedType = terror.ClassOptimizerPlan.New(CodeUnsupportedType, "Unsupported type")
)
Error instances.
Functions ¶
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) RowCount ¶
func (p *Aggregate) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Aggregate) SetFields ¶
func (p *Aggregate) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Aggregate) StartupCost ¶
func (p *Aggregate) StartupCost() float64
StartupCost implements Plan StartupCost interface.
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) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*CheckTable) GetParents ¶
func (p *CheckTable) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*CheckTable) RowCount ¶
func (p *CheckTable) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *DDL) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *DDL) StartupCost() float64
StartupCost implements Plan StartupCost 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) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Deallocate) GetParents ¶
func (p *Deallocate) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Deallocate) RowCount ¶
func (p *Deallocate) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *Delete) RowCount() float64
RowCount implements Plan RowCount 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) 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) AddChild ¶
func (p *Distinct) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Distinct) AddParent ¶
func (p *Distinct) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Distinct) Fields ¶
func (p *Distinct) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Distinct) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Distinct) GetChildren ¶
func (p *Distinct) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Distinct) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Distinct) GetParents ¶
func (p *Distinct) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Distinct) RowCount ¶
func (p *Distinct) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Distinct) SetFields ¶
func (p *Distinct) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Distinct) StartupCost ¶
func (p *Distinct) StartupCost() float64
StartupCost implements Plan StartupCost 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) RowCount ¶
func (p *Execute) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *Execute) StartupCost() float64
StartupCost implements Plan StartupCost 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) RowCount ¶
func (p *Explain) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *Filter) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Filter) SetFields ¶
func (p *Filter) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields 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) RowCount ¶
func (p *Having) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Having) SetFields ¶
func (p *Having) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields 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.
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 // 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) RowCount ¶
func (p *IndexScan) RowCount() float64
RowCount implements Plan RowCount 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) 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) AddChild ¶
func (p *Insert) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Insert) AddParent ¶
func (p *Insert) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Insert) Fields ¶
func (p *Insert) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Insert) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Insert) GetChildren ¶
func (p *Insert) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Insert) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Insert) GetParents ¶
func (p *Insert) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Insert) RowCount ¶
func (p *Insert) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Insert) SetFields ¶
func (p *Insert) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Insert) SetLimit ¶
func (p *Insert) SetLimit(limit float64)
SetLimit implements Plan SetLimit interface.
func (*Insert) StartupCost ¶
func (p *Insert) StartupCost() float64
StartupCost implements Plan StartupCost 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) RowCount ¶
func (p *JoinInner) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *JoinOuter) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *JoinOuter) StartupCost() float64
StartupCost implements Plan StartupCost interface.
type Limit ¶
Limit represents offset and limit plan.
func (*Limit) AddChild ¶
func (p *Limit) AddChild(child Plan)
AddChild implements Plan AddChild interface.
func (*Limit) AddParent ¶
func (p *Limit) AddParent(parent Plan)
AddParent implements Plan AddParent interface.
func (*Limit) Fields ¶
func (p *Limit) Fields() []*ast.ResultField
Fields implements Plan Fields interface.
func (*Limit) GetChildByIndex ¶
GetChildByIndex implements Plan GetChildByIndex interface.
func (*Limit) GetChildren ¶
func (p *Limit) GetChildren() []Plan
GetChildren implements Plan GetChildren interface.
func (*Limit) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*Limit) GetParents ¶
func (p *Limit) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*Limit) RowCount ¶
func (p *Limit) RowCount() float64
RowCount implements Plan RowCount interface.
func (*Limit) SetFields ¶
func (p *Limit) SetFields(fields []*ast.ResultField)
SetFields implements Plan SetFields interface.
func (*Limit) SetLimit ¶
SetLimit implements Plan SetLimit interface. As Limit itself determine the real limit, We just ignore the input, and set the real limit.
func (*Limit) StartupCost ¶
func (p *Limit) StartupCost() float64
StartupCost implements Plan StartupCost 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 parent for plan. AddChild(children Plan) // 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 }
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.
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) RowCount ¶
func (p *Prepare) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *Prepare) StartupCost() float64
StartupCost implements Plan StartupCost 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) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*SelectFields) GetParents ¶
func (p *SelectFields) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*SelectFields) RowCount ¶
func (p *SelectFields) RowCount() float64
RowCount implements Plan RowCount 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) 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) GetParentByIndex ¶
GetParentByIndex implements Plan GetParentByIndex interface.
func (*SelectLock) GetParents ¶
func (p *SelectLock) GetParents() []Plan
GetParents implements Plan GetParents interface.
func (*SelectLock) RowCount ¶
func (p *SelectLock) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *SelectLock) StartupCost() float64
StartupCost implements Plan StartupCost 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) RowCount ¶
func (p *Show) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *ShowDDL) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *Simple) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *Sort) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *TableDual) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *TableScan) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *TableScan) StartupCost() float64
StartupCost implements Plan StartupCost 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) RowCount ¶
func (p *Union) RowCount() float64
RowCount implements Plan RowCount 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) 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) RowCount ¶
func (p *Update) RowCount() float64
RowCount implements Plan RowCount 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) StartupCost ¶
func (p *Update) StartupCost() float64
StartupCost implements Plan StartupCost interface.