plan

package
v0.0.0-...-887f819 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FullRangeCount   = 10000
	HalfRangeCount   = 4000
	MiddleRangeCount = 100
	RowCost          = 1.0
	IndexCost        = 1.1
	SortCost         = 2.0
	FilterRate       = 0.5
)

Pre-defined cost factors.

View Source
const (
	CodeUnsupportedType terror.ErrCode = 1
)

Error codes.

Variables

View Source
var (
	ErrUnsupportedType = terror.ClassOptimizerPlan.New(CodeUnsupportedType, "Unsupported type")
)

Error instances.

Functions

func EstimateCost

func EstimateCost(p Plan) float64

EstimateCost estimates the cost of the plan.

func Refine

func Refine(p Plan) error

Refine tries to build index or table range.

func ToString

func ToString(p Plan) string

ToString explains a Plan, returns description string.

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

func (p *Aggregate) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Aggregate) GetChildren

func (p *Aggregate) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Aggregate) GetParentByIndex

func (p *Aggregate) GetParentByIndex(index int) (parent Plan)

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) SetLimit

func (p *Aggregate) SetLimit(limit float64)

SetLimit implements Plan SetLimit interface.

func (*Aggregate) StartupCost

func (p *Aggregate) StartupCost() float64

StartupCost implements Plan StartupCost interface.

func (*Aggregate) TotalCost

func (p *Aggregate) TotalCost() float64

TotalCost implements Plan TotalCost interface.

type CheckTable

type CheckTable struct {
	Tables []*ast.TableName
	// contains filtered or unexported fields
}

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

func (p *CheckTable) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*CheckTable) GetChildren

func (p *CheckTable) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*CheckTable) GetParentByIndex

func (p *CheckTable) GetParentByIndex(index int) (parent Plan)

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.

func (*CheckTable) TotalCost

func (p *CheckTable) TotalCost() float64

TotalCost implements Plan TotalCost interface.

type DDL

type DDL struct {
	Statement ast.DDLNode
	// contains filtered or unexported fields
}

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

func (p *DDL) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*DDL) GetChildren

func (p *DDL) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*DDL) GetParentByIndex

func (p *DDL) GetParentByIndex(index int) (parent Plan)

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.

func (*DDL) TotalCost

func (p *DDL) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Deallocate) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Deallocate) GetChildren

func (p *Deallocate) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Deallocate) GetParentByIndex

func (p *Deallocate) GetParentByIndex(index int) (parent Plan)

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.

func (*Deallocate) TotalCost

func (p *Deallocate) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Delete) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Delete) GetChildren

func (p *Delete) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Delete) GetParentByIndex

func (p *Delete) GetParentByIndex(index int) (parent Plan)

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.

func (*Delete) TotalCost

func (p *Delete) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Distinct) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Distinct) GetChildren

func (p *Distinct) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Distinct) GetParentByIndex

func (p *Distinct) GetParentByIndex(index int) (parent Plan)

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) SetLimit

func (p *Distinct) SetLimit(limit float64)

SetLimit implements Plan SetLimit interface.

func (*Distinct) StartupCost

func (p *Distinct) StartupCost() float64

StartupCost implements Plan StartupCost interface.

func (*Distinct) TotalCost

func (p *Distinct) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Execute) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Execute) GetChildren

func (p *Execute) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Execute) GetParentByIndex

func (p *Execute) GetParentByIndex(index int) (parent Plan)

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.

func (*Execute) TotalCost

func (p *Execute) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Explain) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Explain) GetChildren

func (p *Explain) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Explain) GetParentByIndex

func (p *Explain) GetParentByIndex(index int) (parent Plan)

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.

func (*Explain) TotalCost

func (p *Explain) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Filter) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Filter) GetChildren

func (p *Filter) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Filter) GetParentByIndex

func (p *Filter) GetParentByIndex(index int) (parent Plan)

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) SetLimit

func (p *Filter) SetLimit(limit float64)

SetLimit implements Plan SetLimit interface.

func (*Filter) StartupCost

func (p *Filter) StartupCost() float64

StartupCost implements Plan StartupCost interface.

func (*Filter) TotalCost

func (p *Filter) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Having) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Having) GetChildren

func (p *Having) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Having) GetParentByIndex

func (p *Having) GetParentByIndex(index int) (parent Plan)

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) SetLimit

func (p *Having) SetLimit(limit float64)

SetLimit implements Plan SetLimit interface.

func (*Having) StartupCost

func (p *Having) StartupCost() float64

StartupCost implements Plan StartupCost interface.

func (*Having) TotalCost

func (p *Having) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *IndexScan) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*IndexScan) GetChildren

func (p *IndexScan) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*IndexScan) GetParentByIndex

func (p *IndexScan) GetParentByIndex(index int) (parent Plan)

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.

func (*IndexScan) TotalCost

func (p *IndexScan) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Insert) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Insert) GetChildren

func (p *Insert) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Insert) GetParentByIndex

func (p *Insert) GetParentByIndex(index int) (parent Plan)

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.

func (*Insert) TotalCost

func (p *Insert) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *JoinInner) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*JoinInner) GetChildren

func (p *JoinInner) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*JoinInner) GetParentByIndex

func (p *JoinInner) GetParentByIndex(index int) (parent Plan)

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.

func (*JoinInner) String

func (p *JoinInner) String() string

func (*JoinInner) TotalCost

func (p *JoinInner) TotalCost() float64

TotalCost implements Plan TotalCost interface.

type JoinOuter

type JoinOuter struct {
	Outer Plan
	Inner Plan
	// contains filtered or unexported fields
}

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

func (p *JoinOuter) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*JoinOuter) GetChildren

func (p *JoinOuter) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*JoinOuter) GetParentByIndex

func (p *JoinOuter) GetParentByIndex(index int) (parent Plan)

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.

func (*JoinOuter) TotalCost

func (p *JoinOuter) TotalCost() float64

TotalCost implements Plan TotalCost interface.

type Limit

type Limit struct {
	Offset uint64
	Count  uint64
	// contains filtered or unexported fields
}

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

func (p *Limit) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Limit) GetChildren

func (p *Limit) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Limit) GetParentByIndex

func (p *Limit) GetParentByIndex(index int) (parent Plan)

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

func (p *Limit) SetLimit(limit float64)

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.

func (*Limit) TotalCost

func (p *Limit) TotalCost() float64

TotalCost implements Plan TotalCost 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.

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.

type Prepare

type Prepare struct {
	Name    string
	SQLText string
	// contains filtered or unexported fields
}

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

func (p *Prepare) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Prepare) GetChildren

func (p *Prepare) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Prepare) GetParentByIndex

func (p *Prepare) GetParentByIndex(index int) (parent Plan)

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.

func (*Prepare) TotalCost

func (p *Prepare) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *SelectFields) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*SelectFields) GetChildren

func (p *SelectFields) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*SelectFields) GetParentByIndex

func (p *SelectFields) GetParentByIndex(index int) (parent Plan)

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.

func (*SelectFields) TotalCost

func (p *SelectFields) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *SelectLock) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*SelectLock) GetChildren

func (p *SelectLock) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*SelectLock) GetParentByIndex

func (p *SelectLock) GetParentByIndex(index int) (parent Plan)

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.

func (*SelectLock) TotalCost

func (p *SelectLock) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Show) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Show) GetChildren

func (p *Show) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Show) GetParentByIndex

func (p *Show) GetParentByIndex(index int) (parent Plan)

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.

func (*Show) TotalCost

func (p *Show) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *ShowDDL) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*ShowDDL) GetChildren

func (p *ShowDDL) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*ShowDDL) GetParentByIndex

func (p *ShowDDL) GetParentByIndex(index int) (parent Plan)

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.

func (*ShowDDL) TotalCost

func (p *ShowDDL) TotalCost() float64

TotalCost implements Plan TotalCost interface.

type Simple

type Simple struct {
	Statement ast.StmtNode
	// contains filtered or unexported fields
}

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

func (p *Simple) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Simple) GetChildren

func (p *Simple) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Simple) GetParentByIndex

func (p *Simple) GetParentByIndex(index int) (parent Plan)

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.

func (*Simple) TotalCost

func (p *Simple) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Sort) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Sort) GetChildren

func (p *Sort) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Sort) GetParentByIndex

func (p *Sort) GetParentByIndex(index int) (parent Plan)

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

func (p *Sort) SetLimit(limit float64)

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.

func (*Sort) TotalCost

func (p *Sort) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *TableDual) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*TableDual) GetChildren

func (p *TableDual) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*TableDual) GetParentByIndex

func (p *TableDual) GetParentByIndex(index int) (parent Plan)

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.

func (*TableDual) TotalCost

func (p *TableDual) TotalCost() float64

TotalCost implements Plan TotalCost interface.

type TableRange

type TableRange struct {
	LowVal  int64
	HighVal int64
}

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

func (p *TableScan) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*TableScan) GetChildren

func (p *TableScan) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*TableScan) GetParentByIndex

func (p *TableScan) GetParentByIndex(index int) (parent Plan)

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.

func (*TableScan) TotalCost

func (p *TableScan) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Union) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Union) GetChildren

func (p *Union) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Union) GetParentByIndex

func (p *Union) GetParentByIndex(index int) (parent Plan)

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.

func (*Union) TotalCost

func (p *Union) TotalCost() float64

TotalCost implements Plan TotalCost 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

func (p *Update) GetChildByIndex(index int) (parent Plan)

GetChildByIndex implements Plan GetChildByIndex interface.

func (*Update) GetChildren

func (p *Update) GetChildren() []Plan

GetChildren implements Plan GetChildren interface.

func (*Update) GetParentByIndex

func (p *Update) GetParentByIndex(index int) (parent Plan)

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.

func (*Update) TotalCost

func (p *Update) TotalCost() float64

TotalCost implements Plan TotalCost interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL