Documentation ¶
Index ¶
- Constants
- Variables
- func BuildPhysicalJoinSchema(joinType JoinType, join PhysicalPlan) *expression.Schema
- func Cacheable(node ast.Node) bool
- func CheckAggCanPushCop(sctx sessionctx.Context, aggFuncs []*aggregation.AggFuncDesc, ...) bool
- func CheckPrivilege(activeRoles []*auth.RoleIdentity, pm privilege.Manager, vs []visitInfo) error
- func CheckTableLock(ctx sessionctx.Context, is infoschema.InfoSchema, vs []visitInfo) error
- func CollectPlanStatsVersion(plan PhysicalPlan, statsInfos map[string]uint64) map[string]uint64
- func DeriveOtherConditions(p *LogicalJoin, deriveLeft bool, deriveRight bool) (leftCond []expression.Expression, rightCond []expression.Expression)
- func EncodePlan(p Plan) string
- func EraseLastSemicolon(stmt ast.StmtNode)
- func ExpandVirtualColumn(columns []*model.ColumnInfo, schema *expression.Schema, ...) []*model.ColumnInfo
- func ExprsHasSideEffects(exprs []expression.Expression) bool
- func ExtractCorColumnsBySchema(corCols []*expression.CorrelatedColumn, schema *expression.Schema) []*expression.CorrelatedColumn
- func ExtractCorrelatedCols(p LogicalPlan) []*expression.CorrelatedColumn
- func FindColumnInfoByID(colInfos []*model.ColumnInfo, id int64) *model.ColumnInfo
- func GenHintsFromPhysicalPlan(p Plan) []*ast.TableOptimizerHint
- func GetDupAgnosticAggCols(p LogicalPlan, oldAggCols []*expression.Column) (isAgg bool, newAggCols []*expression.Column)
- func GetPropByOrderByItems(items []*ByItems) (*property.PhysicalProperty, bool)
- func GetPropByOrderByItemsContainScalarFunc(items []*ByItems) (*property.PhysicalProperty, bool, bool)
- func GetStatsInfo(i interface{}) map[string]uint64
- func GetUpdateColumns(ctx sessionctx.Context, orderedList []*expression.Assignment, schemaLen int) ([]bool, error)
- func HasMaxOneRow(p LogicalPlan, childMaxOneRow []bool) bool
- func InPrepare(p *preprocessor)
- func InTxnRetry(p *preprocessor)
- func IsAutoCommitTxn(ctx sessionctx.Context) bool
- func IsColsAllFromOuterTable(cols []*expression.Column, outerUniqueIDs set.Int64Set) bool
- func IsPointGetWithPKOrUniqueKeyByAutoCommit(ctx sessionctx.Context, p Plan) (bool, error)
- func IsPointUpdateByAutoCommit(ctx sessionctx.Context, p Plan) (bool, error)
- func MatchItems(p *property.PhysicalProperty, items []*ByItems) bool
- func MockContext() sessionctx.Context
- func MockPartitionInfoSchema(definitions []model.PartitionDefinition) infoschema.InfoSchema
- func MockSignedTable() *model.TableInfo
- func MockUnsignedTable() *model.TableInfo
- func MockView() *model.TableInfo
- func NewPSTMTPlanCacheKey(sessionVars *variable.SessionVars, pstmtID uint32, schemaVersion int64) kvcache.Key
- func NewProjInjector() *projInjector
- func NormalizePlan(p Plan) (normalized, digest string)
- func PreparedPlanCacheEnabled() bool
- func Preprocess(ctx sessionctx.Context, node ast.Node, is infoschema.InfoSchema, ...) error
- func RemoveUnnecessaryFirstRow(sctx sessionctx.Context, finalAggFuncs []*aggregation.AggFuncDesc, ...) []*aggregation.AggFuncDesc
- func ReplaceColumnOfExpr(expr expression.Expression, proj *LogicalProjection, schema *expression.Schema) expression.Expression
- func ResolveExprAndReplace(origin expression.Expression, replace map[string]*expression.Column)
- func SetPBColumnsDefaultValue(ctx sessionctx.Context, pbColumns []*tipb.ColumnInfo, ...) error
- func SetPreparedPlanCache(isEnabled bool)
- func SetPstmtIDSchemaVersion(key kvcache.Key, pstmtID uint32, schemaVersion int64)
- func SplitSelCondsWithVirtualColumn(conds []expression.Expression) ([]expression.Expression, []expression.Expression)
- func SupportStreaming(p PhysicalPlan) bool
- func ToString(p Plan) string
- type AdminPlugins
- type AdminPluginsAction
- type AggInfo
- type AggregateFuncExtractor
- type Analyze
- type AnalyzeColumnsTask
- type AnalyzeIndexTask
- type BatchPointGetPlan
- func (p *BatchPointGetPlan) AccessObject() string
- func (p *BatchPointGetPlan) Children() []PhysicalPlan
- func (p *BatchPointGetPlan) ExplainInfo() string
- func (p *BatchPointGetPlan) ExplainNormalizedInfo() string
- func (p *BatchPointGetPlan) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p *BatchPointGetPlan) GetCost(cols []*expression.Column) float64
- func (p BatchPointGetPlan) Init(ctx sessionctx.Context, stats *property.StatsInfo, schema *expression.Schema, ...) *BatchPointGetPlan
- func (p *BatchPointGetPlan) OperatorInfo(normalized bool) string
- func (p *BatchPointGetPlan) OutputNames() types.NameSlice
- func (p *BatchPointGetPlan) ResolveIndices() error
- func (s *BatchPointGetPlan) Schema() *expression.Schema
- func (p *BatchPointGetPlan) SetChild(i int, child PhysicalPlan)
- func (p *BatchPointGetPlan) SetChildren(...PhysicalPlan)
- func (p *BatchPointGetPlan) SetOutputNames(names types.NameSlice)
- func (s *BatchPointGetPlan) SetSchema(schema *expression.Schema)
- func (p *BatchPointGetPlan) StatsCount() float64
- func (p *BatchPointGetPlan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type ByItems
- type CachedPrepareStmt
- type CancelDDLJobs
- type Change
- type CheckIndex
- type CheckIndexRange
- type CheckTable
- type ChecksumTable
- type CleanupIndex
- type ClusterLogTableExtractor
- type ClusterTableExtractor
- type ColWithCmpFuncManager
- type DDL
- type DataSource
- func (ds *DataSource) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (ds *DataSource) Convert2Gathers() (gathers []LogicalPlan)
- func (ds *DataSource) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *DataSource) ExplainInfo() string
- func (ds *DataSource) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (ds DataSource) Init(ctx sessionctx.Context, offset int) *DataSource
- func (s *DataSource) OutputNames() types.NameSlice
- func (ds *DataSource) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (ds *DataSource) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (ds *DataSource) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *DataSource) Schema() *expression.Schema
- func (s *DataSource) SetOutputNames(names types.NameSlice)
- func (s *DataSource) SetSchema(schema *expression.Schema)
- func (ds *DataSource) TableInfo() *model.TableInfo
- type Deallocate
- type Delete
- type ErrExprLoc
- type Execute
- func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema) error
- func (s *Execute) OutputNames() types.NameSlice
- func (p *Execute) ResolveIndices() (err error)
- func (s *Execute) Schema() *expression.Schema
- func (s *Execute) SetOutputNames(names types.NameSlice)
- func (s *Execute) SetSchema(schema *expression.Schema)
- type Explain
- type ExprColumnMap
- type FrameBound
- type IndexAdvise
- type Insert
- type InsertGeneratedColumns
- type InspectionResultTableExtractor
- type InspectionRuleTableExtractor
- type InspectionSummaryTableExtractor
- type JoinType
- type LoadData
- type LoadStats
- type LogicalAggregation
- func (la *LogicalAggregation) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (la *LogicalAggregation) CopyAggHints(agg *LogicalAggregation)
- func (la *LogicalAggregation) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalAggregation) ExplainInfo() string
- func (la *LogicalAggregation) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (la *LogicalAggregation) GetGroupByCols() []*expression.Column
- func (la *LogicalAggregation) GetUsedCols() (usedCols []*expression.Column)
- func (la *LogicalAggregation) HasDistinct() bool
- func (la LogicalAggregation) Init(ctx sessionctx.Context, offset int) *LogicalAggregation
- func (la *LogicalAggregation) IsCompleteModeAgg() bool
- func (la *LogicalAggregation) IsPartialModeAgg() bool
- func (s *LogicalAggregation) OutputNames() types.NameSlice
- func (la *LogicalAggregation) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
- func (la *LogicalAggregation) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (la *LogicalAggregation) PruneColumns(parentUsedCols []*expression.Column) error
- func (la *LogicalAggregation) ResetHintIfConflicted() (preferHash bool, preferStream bool)
- func (s *LogicalAggregation) Schema() *expression.Schema
- func (s *LogicalAggregation) SetOutputNames(names types.NameSlice)
- func (s *LogicalAggregation) SetSchema(schema *expression.Schema)
- type LogicalApply
- func (la *LogicalApply) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalApply) ExplainInfo() string
- func (la *LogicalApply) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (la *LogicalApply) GetHashJoin(prop *property.PhysicalProperty) *PhysicalHashJoin
- func (la LogicalApply) Init(ctx sessionctx.Context, offset int) *LogicalApply
- func (s *LogicalApply) OutputNames() types.NameSlice
- func (la *LogicalApply) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *LogicalApply) Schema() *expression.Schema
- func (s *LogicalApply) SetOutputNames(names types.NameSlice)
- func (s *LogicalApply) SetSchema(schema *expression.Schema)
- type LogicalIndexScan
- func (is *LogicalIndexScan) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (is *LogicalIndexScan) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalIndexScan) ExplainInfo() string
- func (s *LogicalIndexScan) GetPhysicalIndexScan(schema *expression.Schema, stats *property.StatsInfo) *PhysicalIndexScan
- func (is LogicalIndexScan) Init(ctx sessionctx.Context, offset int) *LogicalIndexScan
- func (p *LogicalIndexScan) MatchIndexProp(prop *property.PhysicalProperty) (match bool)
- func (s *LogicalIndexScan) OutputNames() types.NameSlice
- func (is *LogicalIndexScan) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (s *LogicalIndexScan) Schema() *expression.Schema
- func (s *LogicalIndexScan) SetOutputNames(names types.NameSlice)
- func (s *LogicalIndexScan) SetSchema(schema *expression.Schema)
- type LogicalJoin
- func (p *LogicalJoin) AppendJoinConds(eq []*expression.ScalarFunction, left, right, other []expression.Expression)
- func (p *LogicalJoin) AttachOnConds(onConds []expression.Expression)
- func (p *LogicalJoin) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalJoin) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalJoin) ExplainInfo() string
- func (p *LogicalJoin) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalJoin) ExtractJoinKeys(childIdx int) *expression.Schema
- func (p *LogicalJoin) ExtractOnCondition(conditions []expression.Expression, leftSchema *expression.Schema, ...) (eqCond []*expression.ScalarFunction, leftCond []expression.Expression, ...)
- func (p *LogicalJoin) GetJoinKeys() (leftKeys, rightKeys []*expression.Column)
- func (p *LogicalJoin) GetMergeJoin(prop *property.PhysicalProperty, schema *expression.Schema, ...) []PhysicalPlan
- func (p LogicalJoin) Init(ctx sessionctx.Context, offset int) *LogicalJoin
- func (s *LogicalJoin) OutputNames() types.NameSlice
- func (p *LogicalJoin) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
- func (p *LogicalJoin) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalJoin) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *LogicalJoin) Schema() *expression.Schema
- func (s *LogicalJoin) SetOutputNames(names types.NameSlice)
- func (s *LogicalJoin) SetSchema(schema *expression.Schema)
- func (p *LogicalJoin) Shallow() *LogicalJoin
- type LogicalLimit
- func (p *LogicalLimit) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalLimit) Children() []LogicalPlan
- func (p *LogicalLimit) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalLimit) ExplainInfo() string
- func (p *LogicalLimit) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalLimit) HashCode() []byte
- func (p LogicalLimit) Init(ctx sessionctx.Context, offset int) *LogicalLimit
- func (p *LogicalLimit) MaxOneRow() bool
- func (p *LogicalLimit) OutputNames() types.NameSlice
- func (p *LogicalLimit) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalLimit) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalLimit) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalLimit) Schema() *expression.Schema
- func (p *LogicalLimit) SetChild(i int, child LogicalPlan)
- func (p *LogicalLimit) SetChildren(children ...LogicalPlan)
- func (p *LogicalLimit) SetOutputNames(names types.NameSlice)
- type LogicalLock
- func (p *LogicalLock) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalLock) Children() []LogicalPlan
- func (p *LogicalLock) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalLock) ExplainInfo() string
- func (p *LogicalLock) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalLock) HashCode() []byte
- func (p LogicalLock) Init(ctx sessionctx.Context) *LogicalLock
- func (p *LogicalLock) MaxOneRow() bool
- func (p *LogicalLock) OutputNames() types.NameSlice
- func (p *LogicalLock) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalLock) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalLock) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalLock) Schema() *expression.Schema
- func (p *LogicalLock) SetChild(i int, child LogicalPlan)
- func (p *LogicalLock) SetChildren(children ...LogicalPlan)
- func (p *LogicalLock) SetOutputNames(names types.NameSlice)
- type LogicalMaxOneRow
- func (p *LogicalMaxOneRow) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalMaxOneRow) Children() []LogicalPlan
- func (p *LogicalMaxOneRow) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalMaxOneRow) ExplainInfo() string
- func (p *LogicalMaxOneRow) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalMaxOneRow) HashCode() []byte
- func (p LogicalMaxOneRow) Init(ctx sessionctx.Context, offset int) *LogicalMaxOneRow
- func (p *LogicalMaxOneRow) MaxOneRow() bool
- func (p *LogicalMaxOneRow) OutputNames() types.NameSlice
- func (p *LogicalMaxOneRow) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalMaxOneRow) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalMaxOneRow) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalMaxOneRow) Schema() *expression.Schema
- func (p *LogicalMaxOneRow) SetChild(i int, child LogicalPlan)
- func (p *LogicalMaxOneRow) SetChildren(children ...LogicalPlan)
- func (p *LogicalMaxOneRow) SetOutputNames(names types.NameSlice)
- type LogicalMemTable
- func (p *LogicalMemTable) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalMemTable) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p LogicalMemTable) Init(ctx sessionctx.Context, offset int) *LogicalMemTable
- func (s *LogicalMemTable) OutputNames() types.NameSlice
- func (p *LogicalMemTable) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (s *LogicalMemTable) Schema() *expression.Schema
- func (s *LogicalMemTable) SetOutputNames(names types.NameSlice)
- func (s *LogicalMemTable) SetSchema(schema *expression.Schema)
- type LogicalPlan
- type LogicalProjection
- func (p *LogicalProjection) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalProjection) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalProjection) ExplainInfo() string
- func (p *LogicalProjection) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalProjection) GetUsedCols() (usedCols []*expression.Column)
- func (p *LogicalProjection) HashCode() []byte
- func (p LogicalProjection) Init(ctx sessionctx.Context, offset int) *LogicalProjection
- func (s *LogicalProjection) OutputNames() types.NameSlice
- func (p *LogicalProjection) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
- func (p *LogicalProjection) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalProjection) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *LogicalProjection) Schema() *expression.Schema
- func (s *LogicalProjection) SetOutputNames(names types.NameSlice)
- func (s *LogicalProjection) SetSchema(schema *expression.Schema)
- func (p *LogicalProjection) TryToGetChildProp(prop *property.PhysicalProperty) (*property.PhysicalProperty, bool)
- type LogicalSelection
- func (p *LogicalSelection) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalSelection) Children() []LogicalPlan
- func (p *LogicalSelection) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalSelection) ExplainInfo() string
- func (p *LogicalSelection) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalSelection) HashCode() []byte
- func (p LogicalSelection) Init(ctx sessionctx.Context, offset int) *LogicalSelection
- func (p *LogicalSelection) MaxOneRow() bool
- func (p *LogicalSelection) OutputNames() types.NameSlice
- func (p *LogicalSelection) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalSelection) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalSelection) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalSelection) Schema() *expression.Schema
- func (p *LogicalSelection) SetChild(i int, child LogicalPlan)
- func (p *LogicalSelection) SetChildren(children ...LogicalPlan)
- func (p *LogicalSelection) SetOutputNames(names types.NameSlice)
- type LogicalShow
- func (p *LogicalShow) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalShow) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p LogicalShow) Init(ctx sessionctx.Context) *LogicalShow
- func (s *LogicalShow) OutputNames() types.NameSlice
- func (s *LogicalShow) Schema() *expression.Schema
- func (s *LogicalShow) SetOutputNames(names types.NameSlice)
- func (s *LogicalShow) SetSchema(schema *expression.Schema)
- type LogicalShowDDLJobs
- func (p *LogicalShowDDLJobs) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalShowDDLJobs) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p LogicalShowDDLJobs) Init(ctx sessionctx.Context) *LogicalShowDDLJobs
- func (s *LogicalShowDDLJobs) OutputNames() types.NameSlice
- func (s *LogicalShowDDLJobs) Schema() *expression.Schema
- func (s *LogicalShowDDLJobs) SetOutputNames(names types.NameSlice)
- func (s *LogicalShowDDLJobs) SetSchema(schema *expression.Schema)
- type LogicalSort
- func (p *LogicalSort) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalSort) Children() []LogicalPlan
- func (p *LogicalSort) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalSort) ExplainInfo() string
- func (ls *LogicalSort) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalSort) HashCode() []byte
- func (ls LogicalSort) Init(ctx sessionctx.Context, offset int) *LogicalSort
- func (p *LogicalSort) MaxOneRow() bool
- func (p *LogicalSort) OutputNames() types.NameSlice
- func (p *LogicalSort) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalSort) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (ls *LogicalSort) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalSort) Schema() *expression.Schema
- func (p *LogicalSort) SetChild(i int, child LogicalPlan)
- func (p *LogicalSort) SetChildren(children ...LogicalPlan)
- func (p *LogicalSort) SetOutputNames(names types.NameSlice)
- type LogicalTableDual
- func (p *LogicalTableDual) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalTableDual) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalTableDual) ExplainInfo() string
- func (p *LogicalTableDual) HashCode() []byte
- func (p LogicalTableDual) Init(ctx sessionctx.Context, offset int) *LogicalTableDual
- func (s *LogicalTableDual) OutputNames() types.NameSlice
- func (p *LogicalTableDual) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalTableDual) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *LogicalTableDual) Schema() *expression.Schema
- func (s *LogicalTableDual) SetOutputNames(names types.NameSlice)
- func (s *LogicalTableDual) SetSchema(schema *expression.Schema)
- type LogicalTableScan
- func (ts *LogicalTableScan) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (ts *LogicalTableScan) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (_ *property.StatsInfo, err error)
- func (p *LogicalTableScan) ExplainInfo() string
- func (s *LogicalTableScan) GetPhysicalScan(schema *expression.Schema, stats *property.StatsInfo) *PhysicalTableScan
- func (ts LogicalTableScan) Init(ctx sessionctx.Context, offset int) *LogicalTableScan
- func (s *LogicalTableScan) OutputNames() types.NameSlice
- func (ts *LogicalTableScan) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (s *LogicalTableScan) Schema() *expression.Schema
- func (s *LogicalTableScan) SetOutputNames(names types.NameSlice)
- func (s *LogicalTableScan) SetSchema(schema *expression.Schema)
- type LogicalTopN
- func (p *LogicalTopN) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalTopN) Children() []LogicalPlan
- func (lt *LogicalTopN) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalTopN) ExplainInfo() string
- func (lt *LogicalTopN) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalTopN) HashCode() []byte
- func (lt LogicalTopN) Init(ctx sessionctx.Context, offset int) *LogicalTopN
- func (p *LogicalTopN) MaxOneRow() bool
- func (p *LogicalTopN) OutputNames() types.NameSlice
- func (p *LogicalTopN) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalTopN) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (lt *LogicalTopN) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalTopN) Schema() *expression.Schema
- func (p *LogicalTopN) SetChild(i int, child LogicalPlan)
- func (p *LogicalTopN) SetChildren(children ...LogicalPlan)
- func (p *LogicalTopN) SetOutputNames(names types.NameSlice)
- type LogicalUnionAll
- func (p *LogicalUnionAll) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalUnionAll) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p LogicalUnionAll) Init(ctx sessionctx.Context, offset int) *LogicalUnionAll
- func (s *LogicalUnionAll) OutputNames() types.NameSlice
- func (p *LogicalUnionAll) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
- func (p *LogicalUnionAll) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *LogicalUnionAll) Schema() *expression.Schema
- func (s *LogicalUnionAll) SetOutputNames(names types.NameSlice)
- func (s *LogicalUnionAll) SetSchema(schema *expression.Schema)
- type LogicalUnionScan
- func (p *LogicalUnionScan) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalUnionScan) Children() []LogicalPlan
- func (p *LogicalUnionScan) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalUnionScan) ExplainInfo() string
- func (p *LogicalUnionScan) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalUnionScan) HashCode() []byte
- func (p LogicalUnionScan) Init(ctx sessionctx.Context, offset int) *LogicalUnionScan
- func (p *LogicalUnionScan) MaxOneRow() bool
- func (p *LogicalUnionScan) OutputNames() types.NameSlice
- func (p *LogicalUnionScan) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalUnionScan) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalUnionScan) PruneColumns(parentUsedCols []*expression.Column) error
- func (p *LogicalUnionScan) Schema() *expression.Schema
- func (p *LogicalUnionScan) SetChild(i int, child LogicalPlan)
- func (p *LogicalUnionScan) SetChildren(children ...LogicalPlan)
- func (p *LogicalUnionScan) SetOutputNames(names types.NameSlice)
- type LogicalWindow
- func (p *LogicalWindow) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *LogicalWindow) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, ...) (*property.StatsInfo, error)
- func (p *LogicalWindow) ExtractCorrelatedCols() []*expression.CorrelatedColumn
- func (p *LogicalWindow) GetPartitionByCols() []*expression.Column
- func (p *LogicalWindow) GetWindowResultColumns() []*expression.Column
- func (p LogicalWindow) Init(ctx sessionctx.Context, offset int) *LogicalWindow
- func (s *LogicalWindow) OutputNames() types.NameSlice
- func (p *LogicalWindow) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
- func (p *LogicalWindow) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (p *LogicalWindow) PruneColumns(parentUsedCols []*expression.Column) error
- func (s *LogicalWindow) Schema() *expression.Schema
- func (s *LogicalWindow) SetOutputNames(names types.NameSlice)
- func (s *LogicalWindow) SetSchema(schema *expression.Schema)
- type MemTablePredicateExtractor
- type MetricSummaryTableExtractor
- type MetricTableExtractor
- type NominalSort
- func (p *NominalSort) Children() []PhysicalPlan
- func (p *NominalSort) ExplainInfo() string
- func (p *NominalSort) ExplainNormalizedInfo() string
- func (p *NominalSort) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p NominalSort) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *NominalSort
- func (p *NominalSort) ResolveIndices() (err error)
- func (p *NominalSort) Schema() *expression.Schema
- func (p *NominalSort) SetChild(i int, child PhysicalPlan)
- func (p *NominalSort) SetChildren(children ...PhysicalPlan)
- func (p *NominalSort) StatsCount() float64
- func (p *NominalSort) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
- type PBPlanBuilder
- type PSTMTPlanCacheValue
- type PartitionSplitterType
- type PhysicalApply
- type PhysicalHashAgg
- func (p *PhysicalHashAgg) ExplainInfo() string
- func (p *PhysicalHashAgg) ExplainNormalizedInfo() string
- func (p *PhysicalHashAgg) GetCost(inputRows float64, isRoot bool) float64
- func (base PhysicalHashAgg) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *basePhysicalAgg
- func (p *PhysicalHashAgg) ResolveIndices() (err error)
- func (p *PhysicalHashAgg) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalHashJoin
- func (p *PhysicalHashJoin) ExplainInfo() string
- func (p *PhysicalHashJoin) ExplainNormalizedInfo() string
- func (p *PhysicalHashJoin) GetCost(lCnt, rCnt float64) float64
- func (p PhysicalHashJoin) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalHashJoin
- func (p *PhysicalHashJoin) ResolveIndices() (err error)
- type PhysicalIndexHashJoin
- type PhysicalIndexJoin
- func (p *PhysicalIndexJoin) ExplainInfo() string
- func (p *PhysicalIndexJoin) ExplainNormalizedInfo() string
- func (p *PhysicalIndexJoin) GetCost(outerTask, innerTask task) float64
- func (p PhysicalIndexJoin) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalIndexJoin
- func (p *PhysicalIndexJoin) ResolveIndices() (err error)
- type PhysicalIndexLookUpReader
- func (p *PhysicalIndexLookUpReader) ExplainInfo() string
- func (p PhysicalIndexLookUpReader) Init(ctx sessionctx.Context, offset int) *PhysicalIndexLookUpReader
- func (p *PhysicalIndexLookUpReader) ResolveIndices() (err error)
- func (s *PhysicalIndexLookUpReader) Schema() *expression.Schema
- func (s *PhysicalIndexLookUpReader) SetSchema(schema *expression.Schema)
- type PhysicalIndexMergeJoin
- type PhysicalIndexMergeReader
- func (p *PhysicalIndexMergeReader) ExplainInfo() string
- func (p PhysicalIndexMergeReader) Init(ctx sessionctx.Context, offset int) *PhysicalIndexMergeReader
- func (p *PhysicalIndexMergeReader) ResolveIndices() (err error)
- func (s *PhysicalIndexMergeReader) Schema() *expression.Schema
- func (s *PhysicalIndexMergeReader) SetSchema(schema *expression.Schema)
- type PhysicalIndexReader
- func (p *PhysicalIndexReader) ExplainInfo() string
- func (p *PhysicalIndexReader) ExplainNormalizedInfo() string
- func (p PhysicalIndexReader) Init(ctx sessionctx.Context, offset int) *PhysicalIndexReader
- func (p *PhysicalIndexReader) ResolveIndices() (err error)
- func (s *PhysicalIndexReader) Schema() *expression.Schema
- func (p *PhysicalIndexReader) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalIndexReader) SetSchema(_ *expression.Schema)
- type PhysicalIndexScan
- func (p *PhysicalIndexScan) AccessObject() string
- func (p *PhysicalIndexScan) ExplainID() fmt.Stringer
- func (p *PhysicalIndexScan) ExplainInfo() string
- func (p *PhysicalIndexScan) ExplainNormalizedInfo() string
- func (p PhysicalIndexScan) Init(ctx sessionctx.Context, offset int) *PhysicalIndexScan
- func (p *PhysicalIndexScan) IsPartition() (bool, int64)
- func (p *PhysicalIndexScan) IsPointGetByUniqueKey(sc *stmtctx.StatementContext) bool
- func (p *PhysicalIndexScan) OperatorInfo(normalized bool) string
- func (p *PhysicalIndexScan) ResolveIndices() (err error)
- func (s *PhysicalIndexScan) Schema() *expression.Schema
- func (s *PhysicalIndexScan) SetSchema(schema *expression.Schema)
- func (p *PhysicalIndexScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalLimit
- func (p *PhysicalLimit) Children() []PhysicalPlan
- func (p *PhysicalLimit) ExplainInfo() string
- func (p *PhysicalLimit) ExplainNormalizedInfo() string
- func (p *PhysicalLimit) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p PhysicalLimit) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalLimit
- func (p *PhysicalLimit) ResolveIndices() (err error)
- func (p *PhysicalLimit) Schema() *expression.Schema
- func (p *PhysicalLimit) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalLimit) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalLimit) StatsCount() float64
- func (p *PhysicalLimit) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalLock
- func (p *PhysicalLock) Children() []PhysicalPlan
- func (p *PhysicalLock) ExplainInfo() string
- func (p *PhysicalLock) ExplainNormalizedInfo() string
- func (p *PhysicalLock) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p PhysicalLock) Init(ctx sessionctx.Context, stats *property.StatsInfo, ...) *PhysicalLock
- func (p *PhysicalLock) ResolveIndices() (err error)
- func (p *PhysicalLock) Schema() *expression.Schema
- func (p *PhysicalLock) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalLock) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalLock) StatsCount() float64
- func (p *PhysicalLock) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
- type PhysicalMaxOneRow
- func (p *PhysicalMaxOneRow) Children() []PhysicalPlan
- func (p *PhysicalMaxOneRow) ExplainInfo() string
- func (p *PhysicalMaxOneRow) ExplainNormalizedInfo() string
- func (p *PhysicalMaxOneRow) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p PhysicalMaxOneRow) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalMaxOneRow
- func (p *PhysicalMaxOneRow) ResolveIndices() (err error)
- func (p *PhysicalMaxOneRow) Schema() *expression.Schema
- func (p *PhysicalMaxOneRow) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalMaxOneRow) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalMaxOneRow) StatsCount() float64
- func (p *PhysicalMaxOneRow) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
- type PhysicalMemTable
- func (p *PhysicalMemTable) AccessObject() string
- func (p *PhysicalMemTable) ExplainInfo() string
- func (p PhysicalMemTable) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *PhysicalMemTable
- func (p *PhysicalMemTable) OperatorInfo(_ bool) string
- func (p *PhysicalMemTable) ResolveIndices() (err error)
- func (s *PhysicalMemTable) Schema() *expression.Schema
- func (s *PhysicalMemTable) SetSchema(schema *expression.Schema)
- type PhysicalMergeJoin
- func (p *PhysicalMergeJoin) ExplainInfo() string
- func (p *PhysicalMergeJoin) ExplainNormalizedInfo() string
- func (p *PhysicalMergeJoin) GetCost(lCnt, rCnt float64) float64
- func (p PhysicalMergeJoin) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *PhysicalMergeJoin
- func (p *PhysicalMergeJoin) ResolveIndices() (err error)
- type PhysicalPlan
- func DoOptimize(ctx context.Context, sctx sessionctx.Context, flag uint64, logic LogicalPlan) (PhysicalPlan, float64, error)
- func InjectProjBelowAgg(aggPlan PhysicalPlan, aggFuncs []*aggregation.AggFuncDesc, ...) PhysicalPlan
- func InjectProjBelowSort(p PhysicalPlan, orderByItems []*ByItems) PhysicalPlan
- func TurnNominalSortIntoProj(p PhysicalPlan, onlyColumn bool, orderByItems []*ByItems) PhysicalPlan
- type PhysicalProjection
- func (p *PhysicalProjection) ExplainInfo() string
- func (p *PhysicalProjection) ExplainNormalizedInfo() string
- func (p *PhysicalProjection) GetCost(count float64) float64
- func (p PhysicalProjection) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalProjection
- func (p *PhysicalProjection) ResolveIndices() (err error)
- func (s *PhysicalProjection) Schema() *expression.Schema
- func (s *PhysicalProjection) SetSchema(schema *expression.Schema)
- type PhysicalSelection
- func (p *PhysicalSelection) Children() []PhysicalPlan
- func (p *PhysicalSelection) ExplainInfo() string
- func (p *PhysicalSelection) ExplainNormalizedInfo() string
- func (p *PhysicalSelection) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p PhysicalSelection) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalSelection
- func (p *PhysicalSelection) ResolveIndices() (err error)
- func (p *PhysicalSelection) Schema() *expression.Schema
- func (p *PhysicalSelection) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalSelection) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalSelection) StatsCount() float64
- func (p *PhysicalSelection) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalShow
- type PhysicalShowDDLJobs
- type PhysicalShuffle
- func (p *PhysicalShuffle) Children() []PhysicalPlan
- func (p *PhysicalShuffle) ExplainInfo() string
- func (p *PhysicalShuffle) ExplainNormalizedInfo() string
- func (p *PhysicalShuffle) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p PhysicalShuffle) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalShuffle
- func (p *PhysicalShuffle) ResolveIndices() (err error)
- func (p *PhysicalShuffle) Schema() *expression.Schema
- func (p *PhysicalShuffle) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalShuffle) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalShuffle) StatsCount() float64
- func (p *PhysicalShuffle) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
- type PhysicalShuffleDataSourceStub
- func (p PhysicalShuffleDataSourceStub) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalShuffleDataSourceStub
- func (p *PhysicalShuffleDataSourceStub) ResolveIndices() (err error)
- func (s *PhysicalShuffleDataSourceStub) Schema() *expression.Schema
- func (s *PhysicalShuffleDataSourceStub) SetSchema(schema *expression.Schema)
- type PhysicalSort
- func (p *PhysicalSort) Children() []PhysicalPlan
- func (p *PhysicalSort) ExplainInfo() string
- func (p *PhysicalSort) ExplainNormalizedInfo() string
- func (p *PhysicalSort) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p *PhysicalSort) GetCost(count float64, schema *expression.Schema) float64
- func (p PhysicalSort) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalSort
- func (p *PhysicalSort) ResolveIndices() (err error)
- func (p *PhysicalSort) Schema() *expression.Schema
- func (p *PhysicalSort) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalSort) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalSort) StatsCount() float64
- func (p *PhysicalSort) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
- type PhysicalStreamAgg
- func (p *PhysicalStreamAgg) ExplainInfo() string
- func (p *PhysicalStreamAgg) ExplainNormalizedInfo() string
- func (p *PhysicalStreamAgg) GetCost(inputRows float64, isRoot bool) float64
- func (base PhysicalStreamAgg) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *basePhysicalAgg
- func (p *PhysicalStreamAgg) ResolveIndices() (err error)
- func (p *PhysicalStreamAgg) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalTableDual
- func (p *PhysicalTableDual) ExplainInfo() string
- func (p PhysicalTableDual) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *PhysicalTableDual
- func (p *PhysicalTableDual) OutputNames() types.NameSlice
- func (p *PhysicalTableDual) ResolveIndices() (err error)
- func (s *PhysicalTableDual) Schema() *expression.Schema
- func (p *PhysicalTableDual) SetOutputNames(names types.NameSlice)
- func (s *PhysicalTableDual) SetSchema(schema *expression.Schema)
- type PhysicalTableReader
- func (p *PhysicalTableReader) ExplainInfo() string
- func (p *PhysicalTableReader) ExplainNormalizedInfo() string
- func (p PhysicalTableReader) Init(ctx sessionctx.Context, offset int) *PhysicalTableReader
- func (p *PhysicalTableReader) ResolveIndices() error
- func (s *PhysicalTableReader) Schema() *expression.Schema
- func (p *PhysicalTableReader) SetChildren(children ...PhysicalPlan)
- func (s *PhysicalTableReader) SetSchema(schema *expression.Schema)
- type PhysicalTableScan
- func (p *PhysicalTableScan) AccessObject() string
- func (p *PhysicalTableScan) ExplainID() fmt.Stringer
- func (p *PhysicalTableScan) ExplainInfo() string
- func (p *PhysicalTableScan) ExplainNormalizedInfo() string
- func (p PhysicalTableScan) Init(ctx sessionctx.Context, offset int) *PhysicalTableScan
- func (ts *PhysicalTableScan) IsPartition() (bool, int64)
- func (p *PhysicalTableScan) OperatorInfo(normalized bool) string
- func (p *PhysicalTableScan) ResolveIndices() (err error)
- func (s *PhysicalTableScan) Schema() *expression.Schema
- func (ts *PhysicalTableScan) SetIsChildOfIndexLookUp(isIsChildOfIndexLookUp bool)
- func (s *PhysicalTableScan) SetSchema(schema *expression.Schema)
- func (p *PhysicalTableScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalTopN
- func (p *PhysicalTopN) Children() []PhysicalPlan
- func (p *PhysicalTopN) ExplainInfo() string
- func (p *PhysicalTopN) ExplainNormalizedInfo() string
- func (p *PhysicalTopN) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p *PhysicalTopN) GetCost(count float64, isRoot bool) float64
- func (p PhysicalTopN) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalTopN
- func (p *PhysicalTopN) ResolveIndices() (err error)
- func (p *PhysicalTopN) Schema() *expression.Schema
- func (p *PhysicalTopN) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalTopN) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalTopN) StatsCount() float64
- func (p *PhysicalTopN) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type PhysicalUnionAll
- type PhysicalUnionScan
- func (p *PhysicalUnionScan) Children() []PhysicalPlan
- func (p *PhysicalUnionScan) ExplainInfo() string
- func (p *PhysicalUnionScan) ExplainNormalizedInfo() string
- func (p *PhysicalUnionScan) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p PhysicalUnionScan) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalUnionScan
- func (p *PhysicalUnionScan) ResolveIndices() (err error)
- func (p *PhysicalUnionScan) Schema() *expression.Schema
- func (p *PhysicalUnionScan) SetChild(i int, child PhysicalPlan)
- func (p *PhysicalUnionScan) SetChildren(children ...PhysicalPlan)
- func (p *PhysicalUnionScan) StatsCount() float64
- func (p *PhysicalUnionScan) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
- type PhysicalWindow
- func (p *PhysicalWindow) ExplainInfo() string
- func (p PhysicalWindow) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PhysicalWindow
- func (p *PhysicalWindow) ResolveIndices() (err error)
- func (s *PhysicalWindow) Schema() *expression.Schema
- func (s *PhysicalWindow) SetSchema(schema *expression.Schema)
- type Plan
- type PlanBuilder
- func (b *PlanBuilder) Build(ctx context.Context, node ast.Node) (Plan, error)
- func (b *PlanBuilder) BuildDataSourceFromView(ctx context.Context, dbName model.CIStr, tableInfo *model.TableInfo) (LogicalPlan, error)
- func (b *PlanBuilder) GetDBTableInfo() []stmtctx.TableEntry
- func (b *PlanBuilder) GetOptFlag() uint64
- func (b *PlanBuilder) GetVisitInfo() []visitInfo
- func (b *PlanBuilder) TableHints() *tableHintInfo
- type PointGetPlan
- func (p *PointGetPlan) AccessObject() string
- func (p *PointGetPlan) Children() []PhysicalPlan
- func (p *PointGetPlan) ExplainID() fmt.Stringer
- func (p *PointGetPlan) ExplainInfo() string
- func (p *PointGetPlan) ExplainNormalizedInfo() string
- func (p *PointGetPlan) GetChildReqProps(idx int) *property.PhysicalProperty
- func (p *PointGetPlan) GetCost(cols []*expression.Column) float64
- func (p *PointGetPlan) ID() int
- func (p PointGetPlan) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, ...) *PointGetPlan
- func (p *PointGetPlan) OperatorInfo(normalized bool) string
- func (p *PointGetPlan) OutputNames() types.NameSlice
- func (p *PointGetPlan) ResolveIndices() error
- func (p *PointGetPlan) SCtx() sessionctx.Context
- func (p *PointGetPlan) Schema() *expression.Schema
- func (p *PointGetPlan) SelectBlockOffset() int
- func (p *PointGetPlan) SetChild(i int, child PhysicalPlan)
- func (p *PointGetPlan) SetChildren(...PhysicalPlan)
- func (p *PointGetPlan) SetOutputNames(names types.NameSlice)
- func (p *PointGetPlan) Stats() *property.StatsInfo
- func (p *PointGetPlan) StatsCount() float64
- func (p *PointGetPlan) TP() string
- func (p *PointGetPlan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
- type Prepare
- type PreprocessOpt
- type PushedDownLimit
- type QueryTimeRange
- type RecoverIndex
- type ReloadExprPushdownBlacklist
- func (s *ReloadExprPushdownBlacklist) OutputNames() types.NameSlice
- func (p *ReloadExprPushdownBlacklist) ResolveIndices() (err error)
- func (s *ReloadExprPushdownBlacklist) Schema() *expression.Schema
- func (s *ReloadExprPushdownBlacklist) SetOutputNames(names types.NameSlice)
- func (s *ReloadExprPushdownBlacklist) SetSchema(schema *expression.Schema)
- type ReloadOptRuleBlacklist
- func (s *ReloadOptRuleBlacklist) OutputNames() types.NameSlice
- func (p *ReloadOptRuleBlacklist) ResolveIndices() (err error)
- func (s *ReloadOptRuleBlacklist) Schema() *expression.Schema
- func (s *ReloadOptRuleBlacklist) SetOutputNames(names types.NameSlice)
- func (s *ReloadOptRuleBlacklist) SetSchema(schema *expression.Schema)
- type SQLBindOpType
- type SQLBindPlan
- type SelectInto
- type Set
- type ShowContents
- type ShowDDL
- type ShowDDLJobQueries
- func (s *ShowDDLJobQueries) OutputNames() types.NameSlice
- func (p *ShowDDLJobQueries) ResolveIndices() (err error)
- func (s *ShowDDLJobQueries) Schema() *expression.Schema
- func (s *ShowDDLJobQueries) SetOutputNames(names types.NameSlice)
- func (s *ShowDDLJobQueries) SetSchema(schema *expression.Schema)
- type ShowNextRowID
- type ShowSlow
- type Simple
- type SlowQueryExtractor
- type SplitRegion
- type SplitRegionStatus
- func (s *SplitRegionStatus) OutputNames() types.NameSlice
- func (p *SplitRegionStatus) ResolveIndices() (err error)
- func (s *SplitRegionStatus) Schema() *expression.Schema
- func (s *SplitRegionStatus) SetOutputNames(names types.NameSlice)
- func (s *SplitRegionStatus) SetSchema(schema *expression.Schema)
- type TblColPosInfo
- type TblColPosInfoSlice
- type TiKVSingleGather
- func (tg *TiKVSingleGather) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
- func (p *TiKVSingleGather) ExplainInfo() string
- func (sg *TiKVSingleGather) GetPhysicalIndexReader(schema *expression.Schema, stats *property.StatsInfo, ...) *PhysicalIndexReader
- func (sg *TiKVSingleGather) GetPhysicalTableReader(schema *expression.Schema, stats *property.StatsInfo, ...) *PhysicalTableReader
- func (sg TiKVSingleGather) Init(ctx sessionctx.Context, offset int) *TiKVSingleGather
- func (s *TiKVSingleGather) OutputNames() types.NameSlice
- func (p *TiKVSingleGather) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
- func (s *TiKVSingleGather) Schema() *expression.Schema
- func (s *TiKVSingleGather) SetOutputNames(names types.NameSlice)
- func (s *TiKVSingleGather) SetSchema(schema *expression.Schema)
- type Trace
- type Update
- type WindowFrame
- type WindowFuncExtractor
Constants ¶
const ( // TiDBMergeJoin is hint enforce merge join. TiDBMergeJoin = "tidb_smj" // HintSMJ is hint enforce merge join. HintSMJ = "merge_join" // TiDBIndexNestedLoopJoin is hint enforce index nested loop join. TiDBIndexNestedLoopJoin = "tidb_inlj" // HintINLJ is hint enforce index nested loop join. HintINLJ = "inl_join" // HintINLHJ is hint enforce index nested loop hash join. HintINLHJ = "inl_hash_join" // HintINLMJ is hint enforce index nested loop merge join. HintINLMJ = "inl_merge_join" // TiDBHashJoin is hint enforce hash join. TiDBHashJoin = "tidb_hj" // HintHJ is hint enforce hash join. HintHJ = "hash_join" // HintHashAgg is hint enforce hash aggregation. HintHashAgg = "hash_agg" // HintStreamAgg is hint enforce stream aggregation. HintStreamAgg = "stream_agg" // HintUseIndex is hint enforce using some indexes. HintUseIndex = "use_index" // HintIgnoreIndex is hint enforce ignoring some indexes. HintIgnoreIndex = "ignore_index" // HintAggToCop is hint enforce pushing aggregation to coprocessor. HintAggToCop = "agg_to_cop" // HintReadFromStorage is hint enforce some tables read from specific type of storage. HintReadFromStorage = "read_from_storage" // HintTiFlash is a label represents the tiflash storage type. HintTiFlash = "tiflash" // HintTiKV is a label represents the tikv storage type. HintTiKV = "tikv" // HintIndexMerge is a hint to enforce using some indexes at the same time. HintIndexMerge = "use_index_merge" // HintTimeRange is a hint to specify the time range for metrics summary tables HintTimeRange = "time_range" // HintIgnorePlanCache is a hint to enforce ignoring plan cache HintIgnorePlanCache = "ignore_plan_cache" )
const ( // ErrExprInSelect is in select fields for the error of ErrFieldNotInGroupBy ErrExprInSelect = "SELECT list" // ErrExprInOrderBy is in order by items for the error of ErrFieldNotInGroupBy ErrExprInOrderBy = "ORDER BY" )
const ( // TraceFormatRow indicates row tracing format. TraceFormatRow = "row" // TraceFormatJSON indicates json tracing format. TraceFormatJSON = "json" // TraceFormatLog indicates log tracing format. TraceFormatLog = "log" )
const MetricTableTimeFormat = "2006-01-02 15:04:05.999"
MetricTableTimeFormat is the time format for metric table explain and format.
const ( // PartitionHashSplitterType is the splitter splits by hash. PartitionHashSplitterType = iota )
const ( // SelectionFactor is the default factor of the selectivity. // For example, If we have no idea how to estimate the selectivity // of a Selection or a JoinCondition, we can use this default value. SelectionFactor = 0.8 )
Variables ¶
var ( // PreparedPlanCacheCapacity stores the global config "prepared-plan-cache-capacity". PreparedPlanCacheCapacity uint = 100 // PreparedPlanCacheMemoryGuardRatio stores the global config "prepared-plan-cache-memory-guard-ratio". PreparedPlanCacheMemoryGuardRatio = 0.1 // PreparedPlanCacheMaxMemory stores the max memory size defined in the global config "performance-max-memory". PreparedPlanCacheMaxMemory atomic2.Uint64 = *atomic2.NewUint64(math.MaxUint64) )
var ( ErrUnsupportedType = terror.ClassOptimizer.New(mysql.ErrUnsupportedType, mysql.MySQLErrName[mysql.ErrUnsupportedType]) ErrAnalyzeMissIndex = terror.ClassOptimizer.New(mysql.ErrAnalyzeMissIndex, mysql.MySQLErrName[mysql.ErrAnalyzeMissIndex]) ErrWrongParamCount = terror.ClassOptimizer.New(mysql.ErrWrongParamCount, mysql.MySQLErrName[mysql.ErrWrongParamCount]) ErrSchemaChanged = terror.ClassOptimizer.New(mysql.ErrSchemaChanged, mysql.MySQLErrName[mysql.ErrSchemaChanged]) ErrTablenameNotAllowedHere = terror.ClassOptimizer.New(mysql.ErrTablenameNotAllowedHere, mysql.MySQLErrName[mysql.ErrTablenameNotAllowedHere]) ErrNotSupportedYet = terror.ClassOptimizer.New(mysql.ErrNotSupportedYet, mysql.MySQLErrName[mysql.ErrNotSupportedYet]) ErrWrongUsage = terror.ClassOptimizer.New(mysql.ErrWrongUsage, mysql.MySQLErrName[mysql.ErrWrongUsage]) ErrUnknown = terror.ClassOptimizer.New(mysql.ErrUnknown, mysql.MySQLErrName[mysql.ErrUnknown]) ErrUnknownTable = terror.ClassOptimizer.New(mysql.ErrUnknownTable, mysql.MySQLErrName[mysql.ErrUnknownTable]) ErrNoSuchTable = terror.ClassOptimizer.New(mysql.ErrNoSuchTable, mysql.MySQLErrName[mysql.ErrNoSuchTable]) ErrWrongArguments = terror.ClassOptimizer.New(mysql.ErrWrongArguments, mysql.MySQLErrName[mysql.ErrWrongArguments]) ErrWrongNumberOfColumnsInSelect = terror.ClassOptimizer.New(mysql.ErrWrongNumberOfColumnsInSelect, mysql.MySQLErrName[mysql.ErrWrongNumberOfColumnsInSelect]) ErrBadGeneratedColumn = terror.ClassOptimizer.New(mysql.ErrBadGeneratedColumn, mysql.MySQLErrName[mysql.ErrBadGeneratedColumn]) ErrFieldNotInGroupBy = terror.ClassOptimizer.New(mysql.ErrFieldNotInGroupBy, mysql.MySQLErrName[mysql.ErrFieldNotInGroupBy]) ErrBadTable = terror.ClassOptimizer.New(mysql.ErrBadTable, mysql.MySQLErrName[mysql.ErrBadTable]) ErrKeyDoesNotExist = terror.ClassOptimizer.New(mysql.ErrKeyDoesNotExist, mysql.MySQLErrName[mysql.ErrKeyDoesNotExist]) ErrOperandColumns = terror.ClassOptimizer.New(mysql.ErrOperandColumns, mysql.MySQLErrName[mysql.ErrOperandColumns]) ErrInvalidGroupFuncUse = terror.ClassOptimizer.New(mysql.ErrInvalidGroupFuncUse, mysql.MySQLErrName[mysql.ErrInvalidGroupFuncUse]) ErrIllegalReference = terror.ClassOptimizer.New(mysql.ErrIllegalReference, mysql.MySQLErrName[mysql.ErrIllegalReference]) ErrNoDB = terror.ClassOptimizer.New(mysql.ErrNoDB, mysql.MySQLErrName[mysql.ErrNoDB]) ErrUnknownExplainFormat = terror.ClassOptimizer.New(mysql.ErrUnknownExplainFormat, mysql.MySQLErrName[mysql.ErrUnknownExplainFormat]) ErrWrongGroupField = terror.ClassOptimizer.New(mysql.ErrWrongGroupField, mysql.MySQLErrName[mysql.ErrWrongGroupField]) ErrDupFieldName = terror.ClassOptimizer.New(mysql.ErrDupFieldName, mysql.MySQLErrName[mysql.ErrDupFieldName]) ErrNonUpdatableTable = terror.ClassOptimizer.New(mysql.ErrNonUpdatableTable, mysql.MySQLErrName[mysql.ErrNonUpdatableTable]) ErrInternal = terror.ClassOptimizer.New(mysql.ErrInternal, mysql.MySQLErrName[mysql.ErrInternal]) ErrNonUniqTable = terror.ClassOptimizer.New(mysql.ErrNonuniqTable, mysql.MySQLErrName[mysql.ErrNonuniqTable]) ErrWindowInvalidWindowFuncUse = terror.ClassOptimizer.New(mysql.ErrWindowInvalidWindowFuncUse, mysql.MySQLErrName[mysql.ErrWindowInvalidWindowFuncUse]) ErrWindowInvalidWindowFuncAliasUse = terror.ClassOptimizer.New(mysql.ErrWindowInvalidWindowFuncAliasUse, mysql.MySQLErrName[mysql.ErrWindowInvalidWindowFuncAliasUse]) ErrWindowNoSuchWindow = terror.ClassOptimizer.New(mysql.ErrWindowNoSuchWindow, mysql.MySQLErrName[mysql.ErrWindowNoSuchWindow]) ErrWindowCircularityInWindowGraph = terror.ClassOptimizer.New(mysql.ErrWindowCircularityInWindowGraph, mysql.MySQLErrName[mysql.ErrWindowCircularityInWindowGraph]) ErrWindowNoChildPartitioning = terror.ClassOptimizer.New(mysql.ErrWindowNoChildPartitioning, mysql.MySQLErrName[mysql.ErrWindowNoChildPartitioning]) ErrWindowNoInherentFrame = terror.ClassOptimizer.New(mysql.ErrWindowNoInherentFrame, mysql.MySQLErrName[mysql.ErrWindowNoInherentFrame]) ErrWindowNoRedefineOrderBy = terror.ClassOptimizer.New(mysql.ErrWindowNoRedefineOrderBy, mysql.MySQLErrName[mysql.ErrWindowNoRedefineOrderBy]) ErrWindowDuplicateName = terror.ClassOptimizer.New(mysql.ErrWindowDuplicateName, mysql.MySQLErrName[mysql.ErrWindowDuplicateName]) ErrPartitionClauseOnNonpartitioned = terror.ClassOptimizer.New(mysql.ErrPartitionClauseOnNonpartitioned, mysql.MySQLErrName[mysql.ErrPartitionClauseOnNonpartitioned]) ErrWindowFrameStartIllegal = terror.ClassOptimizer.New(mysql.ErrWindowFrameStartIllegal, mysql.MySQLErrName[mysql.ErrWindowFrameStartIllegal]) ErrWindowFrameEndIllegal = terror.ClassOptimizer.New(mysql.ErrWindowFrameEndIllegal, mysql.MySQLErrName[mysql.ErrWindowFrameEndIllegal]) ErrWindowFrameIllegal = terror.ClassOptimizer.New(mysql.ErrWindowFrameIllegal, mysql.MySQLErrName[mysql.ErrWindowFrameIllegal]) ErrWindowRangeFrameOrderType = terror.ClassOptimizer.New(mysql.ErrWindowRangeFrameOrderType, mysql.MySQLErrName[mysql.ErrWindowRangeFrameOrderType]) ErrWindowRangeFrameTemporalType = terror.ClassOptimizer.New(mysql.ErrWindowRangeFrameTemporalType, mysql.MySQLErrName[mysql.ErrWindowRangeFrameTemporalType]) ErrWindowRangeFrameNumericType = terror.ClassOptimizer.New(mysql.ErrWindowRangeFrameNumericType, mysql.MySQLErrName[mysql.ErrWindowRangeFrameNumericType]) ErrWindowRangeBoundNotConstant = terror.ClassOptimizer.New(mysql.ErrWindowRangeBoundNotConstant, mysql.MySQLErrName[mysql.ErrWindowRangeBoundNotConstant]) ErrWindowRowsIntervalUse = terror.ClassOptimizer.New(mysql.ErrWindowRowsIntervalUse, mysql.MySQLErrName[mysql.ErrWindowRowsIntervalUse]) ErrWindowFunctionIgnoresFrame = terror.ClassOptimizer.New(mysql.ErrWindowFunctionIgnoresFrame, mysql.MySQLErrName[mysql.ErrWindowFunctionIgnoresFrame]) ErrUnsupportedOnGeneratedColumn = terror.ClassOptimizer.New(mysql.ErrUnsupportedOnGeneratedColumn, mysql.MySQLErrName[mysql.ErrUnsupportedOnGeneratedColumn]) ErrPrivilegeCheckFail = terror.ClassOptimizer.New(mysql.ErrPrivilegeCheckFail, mysql.MySQLErrName[mysql.ErrPrivilegeCheckFail]) ErrInvalidWildCard = terror.ClassOptimizer.New(mysql.ErrInvalidWildCard, mysql.MySQLErrName[mysql.ErrInvalidWildCard]) ErrMixOfGroupFuncAndFields = terror.ClassOptimizer.New(mysql.ErrMixOfGroupFuncAndFieldsIncompatible, mysql.MySQLErrName[mysql.ErrMixOfGroupFuncAndFieldsIncompatible]) ErrDBaccessDenied = terror.ClassOptimizer.New(mysql.ErrDBaccessDenied, mysql.MySQLErrName[mysql.ErrDBaccessDenied]) ErrTableaccessDenied = terror.ClassOptimizer.New(mysql.ErrTableaccessDenied, mysql.MySQLErrName[mysql.ErrTableaccessDenied]) ErrSpecificAccessDenied = terror.ClassOptimizer.New(mysql.ErrSpecificAccessDenied, mysql.MySQLErrName[mysql.ErrSpecificAccessDenied]) ErrViewNoExplain = terror.ClassOptimizer.New(mysql.ErrViewNoExplain, mysql.MySQLErrName[mysql.ErrViewNoExplain]) ErrWrongValueCountOnRow = terror.ClassOptimizer.New(mysql.ErrWrongValueCountOnRow, mysql.MySQLErrName[mysql.ErrWrongValueCountOnRow]) ErrViewInvalid = terror.ClassOptimizer.New(mysql.ErrViewInvalid, mysql.MySQLErrName[mysql.ErrViewInvalid]) ErrNoSuchThread = terror.ClassOptimizer.New(mysql.ErrNoSuchThread, mysql.MySQLErrName[mysql.ErrNoSuchThread]) ErrUnknownColumn = terror.ClassOptimizer.New(mysql.ErrBadField, mysql.MySQLErrName[mysql.ErrBadField]) ErrCartesianProductUnsupported = terror.ClassOptimizer.New(mysql.ErrCartesianProductUnsupported, mysql.MySQLErrName[mysql.ErrCartesianProductUnsupported]) ErrStmtNotFound = terror.ClassOptimizer.New(mysql.ErrPreparedStmtNotFound, mysql.MySQLErrName[mysql.ErrPreparedStmtNotFound]) ErrAmbiguous = terror.ClassOptimizer.New(mysql.ErrNonUniq, mysql.MySQLErrName[mysql.ErrNonUniq]) // Since we cannot know if user loggined with a password, use message of ErrAccessDeniedNoPassword instead ErrAccessDenied = terror.ClassOptimizer.New(mysql.ErrAccessDenied, mysql.MySQLErrName[mysql.ErrAccessDeniedNoPassword]) )
error definitions.
var AllowCartesianProduct = atomic.NewBool(true)
AllowCartesianProduct means whether tidb allows cartesian join without equal conditions.
var DefaultDisabledLogicalRulesList *atomic.Value
DefaultDisabledLogicalRulesList indicates the logical rules which should be banned.
var EvalSubquery func(ctx context.Context, p PhysicalPlan, is infoschema.InfoSchema, sctx sessionctx.Context) ([][]types.Datum, error)
EvalSubquery evaluates incorrelated subqueries once.
var ForceUseOuterBuild4Test = false
ForceUseOuterBuild4Test is a test option to control forcing use outer input as build. TODO: use hint and remove this variable
var ForcedHashLeftJoin4Test = false
ForcedHashLeftJoin4Test is a test option to force using HashLeftJoin TODO: use hint and remove this variable
var OptimizeAstNode func(ctx context.Context, sctx sessionctx.Context, node ast.Node, is infoschema.InfoSchema) (Plan, types.NameSlice, error)
OptimizeAstNode optimizes the query to a physical plan directly.
Functions ¶
func BuildPhysicalJoinSchema ¶
func BuildPhysicalJoinSchema(joinType JoinType, join PhysicalPlan) *expression.Schema
BuildPhysicalJoinSchema builds the schema of PhysicalJoin from it's children's schema.
func Cacheable ¶
Cacheable checks whether the input ast is cacheable. Handle "ignore_plan_cache()" hint If there are multiple hints, only one will take effect
func CheckAggCanPushCop ¶
func CheckAggCanPushCop(sctx sessionctx.Context, aggFuncs []*aggregation.AggFuncDesc, groupByItems []expression.Expression, storeType kv.StoreType) bool
CheckAggCanPushCop checks whether the aggFuncs and groupByItems can be pushed down to coprocessor.
func CheckPrivilege ¶
func CheckPrivilege(activeRoles []*auth.RoleIdentity, pm privilege.Manager, vs []visitInfo) error
CheckPrivilege checks the privilege for a user.
func CheckTableLock ¶
func CheckTableLock(ctx sessionctx.Context, is infoschema.InfoSchema, vs []visitInfo) error
CheckTableLock checks the table lock.
func CollectPlanStatsVersion ¶
func CollectPlanStatsVersion(plan PhysicalPlan, statsInfos map[string]uint64) map[string]uint64
CollectPlanStatsVersion uses to collect the statistics version of the plan.
func DeriveOtherConditions ¶
func DeriveOtherConditions(p *LogicalJoin, deriveLeft bool, deriveRight bool) (leftCond []expression.Expression, rightCond []expression.Expression)
DeriveOtherConditions given a LogicalJoin, check the OtherConditions to see if we can derive more conditions for left/right child pushdown.
func EncodePlan ¶
EncodePlan is used to encodePlan the plan to the plan tree with compressing.
func EraseLastSemicolon ¶
EraseLastSemicolon removes last semicolon of sql.
func ExpandVirtualColumn ¶
func ExpandVirtualColumn(columns []*model.ColumnInfo, schema *expression.Schema, colsInfo []*model.ColumnInfo) []*model.ColumnInfo
ExpandVirtualColumn expands the virtual column's dependent columns to ts's schema and column.
func ExprsHasSideEffects ¶
func ExprsHasSideEffects(exprs []expression.Expression) bool
ExprsHasSideEffects checks if any of the expressions has side effects.
func ExtractCorColumnsBySchema ¶
func ExtractCorColumnsBySchema(corCols []*expression.CorrelatedColumn, schema *expression.Schema) []*expression.CorrelatedColumn
ExtractCorColumnsBySchema only extracts the correlated columns that match the specified schema. e.g. If the correlated columns from plan are [t1.a, t2.a, t3.a] and specified schema is [t2.a, t2.b, t2.c], only [t2.a] is returned.
func ExtractCorrelatedCols ¶
func ExtractCorrelatedCols(p LogicalPlan) []*expression.CorrelatedColumn
ExtractCorrelatedCols recursively extracts all of the correlated columns from a plan tree by calling LogicalPlan.ExtractCorrelatedCols.
func FindColumnInfoByID ¶
func FindColumnInfoByID(colInfos []*model.ColumnInfo, id int64) *model.ColumnInfo
FindColumnInfoByID finds ColumnInfo in cols by ID.
func GenHintsFromPhysicalPlan ¶
func GenHintsFromPhysicalPlan(p Plan) []*ast.TableOptimizerHint
GenHintsFromPhysicalPlan generates hints from physical plan.
func GetDupAgnosticAggCols ¶
func GetDupAgnosticAggCols( p LogicalPlan, oldAggCols []*expression.Column, ) (isAgg bool, newAggCols []*expression.Column)
GetDupAgnosticAggCols checks whether a LogicalPlan is LogicalAggregation. It extracts all the columns from the duplicate agnostic aggregate functions. The returned column set is nil if not all the aggregate functions are duplicate agnostic. Only the following functions are considered to be duplicate agnostic:
- MAX(arg)
- MIN(arg)
- FIRST_ROW(arg)
- Other agg functions with DISTINCT flag, like SUM(DISTINCT arg)
func GetPropByOrderByItems ¶
func GetPropByOrderByItems(items []*ByItems) (*property.PhysicalProperty, bool)
GetPropByOrderByItems will check if this sort property can be pushed or not. In order to simplify the problem, we only consider the case that all expression are columns.
func GetPropByOrderByItemsContainScalarFunc ¶
func GetPropByOrderByItemsContainScalarFunc(items []*ByItems) (*property.PhysicalProperty, bool, bool)
GetPropByOrderByItemsContainScalarFunc will check if this sort property can be pushed or not. In order to simplify the problem, we only consider the case that all expression are columns or some special scalar functions.
func GetStatsInfo ¶
GetStatsInfo gets the statistics info from a physical plan tree.
func GetUpdateColumns ¶
func GetUpdateColumns(ctx sessionctx.Context, orderedList []*expression.Assignment, schemaLen int) ([]bool, error)
GetUpdateColumns gets the columns of updated lists.
func HasMaxOneRow ¶
func HasMaxOneRow(p LogicalPlan, childMaxOneRow []bool) bool
HasMaxOneRow returns if the LogicalPlan will output at most one row.
func InPrepare ¶
func InPrepare(p *preprocessor)
InPrepare is a PreprocessOpt that indicates preprocess is executing under prepare statement.
func InTxnRetry ¶
func InTxnRetry(p *preprocessor)
InTxnRetry is a PreprocessOpt that indicates preprocess is executing under transaction retry.
func IsAutoCommitTxn ¶
func IsAutoCommitTxn(ctx sessionctx.Context) bool
IsAutoCommitTxn checks if session is in autocommit mode and not InTxn used for fast plan like point get
func IsColsAllFromOuterTable ¶
func IsColsAllFromOuterTable(cols []*expression.Column, outerUniqueIDs set.Int64Set) bool
IsColsAllFromOuterTable check whether the cols all from outer plan
func IsPointGetWithPKOrUniqueKeyByAutoCommit ¶
func IsPointGetWithPKOrUniqueKeyByAutoCommit(ctx sessionctx.Context, p Plan) (bool, error)
IsPointGetWithPKOrUniqueKeyByAutoCommit returns true when meets following conditions:
- ctx is auto commit tagged
- session is not InTxn
- plan is point get by pk, or point get by unique index (no double read)
func IsPointUpdateByAutoCommit ¶
func IsPointUpdateByAutoCommit(ctx sessionctx.Context, p Plan) (bool, error)
IsPointUpdateByAutoCommit checks if plan p is point update and is in autocommit context
func MatchItems ¶
func MatchItems(p *property.PhysicalProperty, items []*ByItems) bool
MatchItems checks if this prop's columns can match by items totally.
func MockContext ¶
func MockContext() sessionctx.Context
MockContext is only used for plan related tests.
func MockPartitionInfoSchema ¶
func MockPartitionInfoSchema(definitions []model.PartitionDefinition) infoschema.InfoSchema
MockPartitionInfoSchema mocks an info schema for partition table.
func MockSignedTable ¶
MockSignedTable is only used for plan related tests.
func MockUnsignedTable ¶
MockUnsignedTable is only used for plan related tests.
func NewPSTMTPlanCacheKey ¶
func NewPSTMTPlanCacheKey(sessionVars *variable.SessionVars, pstmtID uint32, schemaVersion int64) kvcache.Key
NewPSTMTPlanCacheKey creates a new pstmtPlanCacheKey object.
func NormalizePlan ¶
NormalizePlan is used to normalize the plan and generate plan digest.
func PreparedPlanCacheEnabled ¶
func PreparedPlanCacheEnabled() bool
PreparedPlanCacheEnabled returns whether the prepared plan cache is enabled.
func Preprocess ¶
func Preprocess(ctx sessionctx.Context, node ast.Node, is infoschema.InfoSchema, preprocessOpt ...PreprocessOpt) error
Preprocess resolves table names of the node, and checks some statements validation.
func RemoveUnnecessaryFirstRow ¶
func RemoveUnnecessaryFirstRow( sctx sessionctx.Context, finalAggFuncs []*aggregation.AggFuncDesc, finalGbyItems []expression.Expression, partialAggFuncs []*aggregation.AggFuncDesc, partialGbyItems []expression.Expression, partialSchema *expression.Schema, funcMap map[*aggregation.AggFuncDesc]*aggregation.AggFuncDesc) []*aggregation.AggFuncDesc
RemoveUnnecessaryFirstRow removes unnecessary FirstRow of the aggregation. This function can be used for both LogicalAggregation and PhysicalAggregation. When the select column is same with the group by key, the column can be removed and gets value from the group by key. e.g select a, count(b) from t group by a; The schema is [firstrow(a), count(b), a]. The column firstrow(a) is unnecessary. Can optimize the schema to [count(b), a] , and change the index to get value.
func ReplaceColumnOfExpr ¶
func ReplaceColumnOfExpr(expr expression.Expression, proj *LogicalProjection, schema *expression.Schema) expression.Expression
ReplaceColumnOfExpr replaces column of expression by another LogicalProjection.
func ResolveExprAndReplace ¶
func ResolveExprAndReplace(origin expression.Expression, replace map[string]*expression.Column)
ResolveExprAndReplace replaces columns fields of expressions by children logical plans.
func SetPBColumnsDefaultValue ¶
func SetPBColumnsDefaultValue(ctx sessionctx.Context, pbColumns []*tipb.ColumnInfo, columns []*model.ColumnInfo) error
SetPBColumnsDefaultValue sets the default values of tipb.ColumnInfos.
func SetPreparedPlanCache ¶
func SetPreparedPlanCache(isEnabled bool)
SetPreparedPlanCache sets isEnabled to true, then prepared plan cache is enabled.
func SetPstmtIDSchemaVersion ¶
SetPstmtIDSchemaVersion implements PstmtCacheKeyMutator interface to change pstmtID and schemaVersion of cacheKey. so we can reuse Key instead of new every time.
func SplitSelCondsWithVirtualColumn ¶
func SplitSelCondsWithVirtualColumn(conds []expression.Expression) ([]expression.Expression, []expression.Expression)
SplitSelCondsWithVirtualColumn filter the select conditions which contain virtual column
func SupportStreaming ¶
func SupportStreaming(p PhysicalPlan) bool
SupportStreaming returns true if a pushed down operation supports using coprocessor streaming API. Note that this function handle pushed down physical plan only! It's called in constructDAGReq. Some plans are difficult (if possible) to implement streaming, and some are pointless to do so. TODO: Support more kinds of physical plan.
Types ¶
type AdminPlugins ¶
type AdminPlugins struct { Action AdminPluginsAction Plugins []string // contains filtered or unexported fields }
AdminPlugins administrates tidb plugins.
func (*AdminPlugins) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*AdminPlugins) ResolveIndices ¶
func (p *AdminPlugins) ResolveIndices() (err error)
func (*AdminPlugins) Schema ¶
func (s *AdminPlugins) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*AdminPlugins) SetOutputNames ¶
func (*AdminPlugins) SetSchema ¶
func (s *AdminPlugins) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type AdminPluginsAction ¶
type AdminPluginsAction int
AdminPluginsAction indicate action will be taken on plugins.
const ( // Enable indicates enable plugins. Enable AdminPluginsAction = iota + 1 // Disable indicates disable plugins. Disable )
type AggInfo ¶
type AggInfo struct { AggFuncs []*aggregation.AggFuncDesc GroupByItems []expression.Expression Schema *expression.Schema }
AggInfo stores the information of an Aggregation.
func BuildFinalModeAggregation ¶
func BuildFinalModeAggregation( sctx sessionctx.Context, original *AggInfo, partialIsCop bool) (partial, final *AggInfo, funcMap map[*aggregation.AggFuncDesc]*aggregation.AggFuncDesc)
BuildFinalModeAggregation splits either LogicalAggregation or PhysicalAggregation to finalAgg and partial1Agg, returns the information of partial and final agg. partialIsCop means whether partial agg is a cop task.
type AggregateFuncExtractor ¶
type AggregateFuncExtractor struct { // AggFuncs is the collected AggregateFuncExprs. AggFuncs []*ast.AggregateFuncExpr // contains filtered or unexported fields }
AggregateFuncExtractor visits Expr tree. It converts ColunmNameExpr to AggregateFuncExpr and collects AggregateFuncExpr.
type Analyze ¶
type Analyze struct { ColTasks []AnalyzeColumnsTask IdxTasks []AnalyzeIndexTask Opts map[ast.AnalyzeOptionType]uint64 // contains filtered or unexported fields }
Analyze represents an analyze plan
func (*Analyze) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Analyze) ResolveIndices ¶
func (p *Analyze) ResolveIndices() (err error)
func (*Analyze) Schema ¶
func (s *Analyze) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Analyze) SetOutputNames ¶
func (*Analyze) SetSchema ¶
func (s *Analyze) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type AnalyzeColumnsTask ¶
type AnalyzeColumnsTask struct { PKInfo *model.ColumnInfo ColsInfo []*model.ColumnInfo TblInfo *model.TableInfo // contains filtered or unexported fields }
AnalyzeColumnsTask is used for analyze columns.
type AnalyzeIndexTask ¶
type AnalyzeIndexTask struct { IndexInfo *model.IndexInfo TblInfo *model.TableInfo // contains filtered or unexported fields }
AnalyzeIndexTask is used for analyze index.
type BatchPointGetPlan ¶
type BatchPointGetPlan struct { TblInfo *model.TableInfo IndexInfo *model.IndexInfo Handles []int64 HandleParams []*driver.ParamMarkerExpr IndexValues [][]types.Datum IndexValueParams [][]*driver.ParamMarkerExpr PartitionColPos int KeepOrder bool Desc bool Lock bool LockWaitTime int64 Columns []*model.ColumnInfo // contains filtered or unexported fields }
BatchPointGetPlan represents a physical plan which contains a bunch of keys reference the same table and use the same `unique key`
func (*BatchPointGetPlan) AccessObject ¶
func (p *BatchPointGetPlan) AccessObject() string
AccessObject implements physicalScan interface.
func (*BatchPointGetPlan) Children ¶
func (p *BatchPointGetPlan) Children() []PhysicalPlan
Children gets all the children.
func (*BatchPointGetPlan) ExplainInfo ¶
func (p *BatchPointGetPlan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*BatchPointGetPlan) ExplainNormalizedInfo ¶
func (p *BatchPointGetPlan) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*BatchPointGetPlan) GetChildReqProps ¶
func (p *BatchPointGetPlan) GetChildReqProps(idx int) *property.PhysicalProperty
GetChildReqProps gets the required property by child index.
func (*BatchPointGetPlan) GetCost ¶
func (p *BatchPointGetPlan) GetCost(cols []*expression.Column) float64
GetCost returns cost of the PointGetPlan.
func (BatchPointGetPlan) Init ¶
func (p BatchPointGetPlan) Init(ctx sessionctx.Context, stats *property.StatsInfo, schema *expression.Schema, names []*types.FieldName, offset int) *BatchPointGetPlan
Init initializes BatchPointGetPlan.
func (*BatchPointGetPlan) OperatorInfo ¶
func (p *BatchPointGetPlan) OperatorInfo(normalized bool) string
OperatorInfo implements dataAccesser interface.
func (*BatchPointGetPlan) OutputNames ¶
func (p *BatchPointGetPlan) OutputNames() types.NameSlice
OutputNames returns the outputting names of each column.
func (*BatchPointGetPlan) ResolveIndices ¶
func (p *BatchPointGetPlan) ResolveIndices() error
ResolveIndices resolves the indices for columns. After doing this, the columns can evaluate the rows by their indices.
func (*BatchPointGetPlan) Schema ¶
func (s *BatchPointGetPlan) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*BatchPointGetPlan) SetChild ¶
func (p *BatchPointGetPlan) SetChild(i int, child PhysicalPlan)
SetChild sets a specific child for the plan.
func (*BatchPointGetPlan) SetChildren ¶
func (p *BatchPointGetPlan) SetChildren(...PhysicalPlan)
SetChildren sets the children for the plan.
func (*BatchPointGetPlan) SetOutputNames ¶
func (p *BatchPointGetPlan) SetOutputNames(names types.NameSlice)
SetOutputNames sets the outputting name by the given slice.
func (*BatchPointGetPlan) SetSchema ¶
func (s *BatchPointGetPlan) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
func (*BatchPointGetPlan) StatsCount ¶
func (p *BatchPointGetPlan) StatsCount() float64
StatsCount will return the the RowCount of property.StatsInfo for this plan.
func (*BatchPointGetPlan) ToPB ¶
func (p *BatchPointGetPlan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB converts physical plan to tipb executor.
type ByItems ¶
type ByItems struct { Expr expression.Expression Desc bool }
ByItems wraps a "by" item.
type CachedPrepareStmt ¶
type CachedPrepareStmt struct { PreparedAst *ast.Prepared VisitInfos []visitInfo ColumnInfos interface{} Executor interface{} NormalizedSQL string NormalizedPlan string SQLDigest string PlanDigest string }
CachedPrepareStmt store prepared ast from PrepareExec and other related fields
type CancelDDLJobs ¶
type CancelDDLJobs struct { JobIDs []int64 // contains filtered or unexported fields }
CancelDDLJobs represents a cancel DDL jobs plan.
func (*CancelDDLJobs) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*CancelDDLJobs) ResolveIndices ¶
func (p *CancelDDLJobs) ResolveIndices() (err error)
func (*CancelDDLJobs) Schema ¶
func (s *CancelDDLJobs) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*CancelDDLJobs) SetOutputNames ¶
func (*CancelDDLJobs) SetSchema ¶
func (s *CancelDDLJobs) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Change ¶
type Change struct { *ast.ChangeStmt // contains filtered or unexported fields }
Change represents a change plan.
func (*Change) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Change) ResolveIndices ¶
func (p *Change) ResolveIndices() (err error)
func (*Change) Schema ¶
func (s *Change) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Change) SetOutputNames ¶
func (*Change) SetSchema ¶
func (s *Change) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type CheckIndex ¶
type CheckIndex struct { IndexLookUpReader *PhysicalIndexLookUpReader DBName string IdxName string // contains filtered or unexported fields }
CheckIndex is used for checking index data, built from the 'admin check index' statement.
func (*CheckIndex) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*CheckIndex) ResolveIndices ¶
func (p *CheckIndex) ResolveIndices() (err error)
func (*CheckIndex) Schema ¶
func (s *CheckIndex) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*CheckIndex) SetOutputNames ¶
func (*CheckIndex) SetSchema ¶
func (s *CheckIndex) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type CheckIndexRange ¶
type CheckIndexRange struct { Table *ast.TableName IndexName string HandleRanges []ast.HandleRange // contains filtered or unexported fields }
CheckIndexRange is used for checking index data, output the index values that handle within begin and end.
func (*CheckIndexRange) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*CheckIndexRange) ResolveIndices ¶
func (p *CheckIndexRange) ResolveIndices() (err error)
func (*CheckIndexRange) Schema ¶
func (s *CheckIndexRange) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*CheckIndexRange) SetOutputNames ¶
func (*CheckIndexRange) SetSchema ¶
func (s *CheckIndexRange) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type CheckTable ¶
type CheckTable struct { DBName string Table table.Table IndexInfos []*model.IndexInfo IndexLookUpReaders []*PhysicalIndexLookUpReader // contains filtered or unexported fields }
CheckTable is used for checking table data, built from the 'admin check table' statement.
func (*CheckTable) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*CheckTable) ResolveIndices ¶
func (p *CheckTable) ResolveIndices() (err error)
func (*CheckTable) Schema ¶
func (s *CheckTable) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*CheckTable) SetOutputNames ¶
func (*CheckTable) SetSchema ¶
func (s *CheckTable) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ChecksumTable ¶
ChecksumTable is used for calculating table checksum, built from the `admin checksum table` statement.
func (*ChecksumTable) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ChecksumTable) ResolveIndices ¶
func (p *ChecksumTable) ResolveIndices() (err error)
func (*ChecksumTable) Schema ¶
func (s *ChecksumTable) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ChecksumTable) SetOutputNames ¶
func (*ChecksumTable) SetSchema ¶
func (s *ChecksumTable) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type CleanupIndex ¶
type CleanupIndex struct { Table *ast.TableName IndexName string // contains filtered or unexported fields }
CleanupIndex is used to delete dangling index data.
func (*CleanupIndex) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*CleanupIndex) ResolveIndices ¶
func (p *CleanupIndex) ResolveIndices() (err error)
func (*CleanupIndex) Schema ¶
func (s *CleanupIndex) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*CleanupIndex) SetOutputNames ¶
func (*CleanupIndex) SetSchema ¶
func (s *CleanupIndex) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ClusterLogTableExtractor ¶
type ClusterLogTableExtractor struct { // SkipRequest means the where clause always false, we don't need to request any component SkipRequest bool // NodeTypes represents all components types we should send request to. // e.g: // 1. SELECT * FROM cluster_log WHERE type='tikv' // 2. SELECT * FROM cluster_log WHERE type in ('tikv', 'tidb') NodeTypes set.StringSet // Instances represents all components instances we should send request to. // e.g: // 1. SELECT * FROM cluster_log WHERE instance='192.168.1.7:2379' // 2. SELECT * FROM cluster_log WHERE instance in ('192.168.1.7:2379', '192.168.1.9:2379') Instances set.StringSet // StartTime represents the beginning time of log message // e.g: SELECT * FROM cluster_log WHERE time>'2019-10-10 10:10:10.999' StartTime int64 // EndTime represents the ending time of log message // e.g: SELECT * FROM cluster_log WHERE time<'2019-10-11 10:10:10.999' EndTime int64 // Pattern is used to filter the log message // e.g: // 1. SELECT * FROM cluster_log WHERE message like '%gc%' // 2. SELECT * FROM cluster_log WHERE message regexp '.*' Patterns []string LogLevels set.StringSet // contains filtered or unexported fields }
ClusterLogTableExtractor is used to extract some predicates of `cluster_config`
func (*ClusterLogTableExtractor) Extract ¶
func (e *ClusterLogTableExtractor) Extract( ctx sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) []expression.Expression
Extract implements the MemTablePredicateExtractor Extract interface
func (*ClusterLogTableExtractor) GetTimeRange ¶
func (e *ClusterLogTableExtractor) GetTimeRange(isFailpointTestModeSkipCheck bool) (int64, int64)
GetTimeRange extract startTime and endTime
type ClusterTableExtractor ¶
type ClusterTableExtractor struct { // SkipRequest means the where clause always false, we don't need to request any component SkipRequest bool // NodeTypes represents all components types we should send request to. // e.g: // 1. SELECT * FROM cluster_config WHERE type='tikv' // 2. SELECT * FROM cluster_config WHERE type in ('tikv', 'tidb') NodeTypes set.StringSet // Instances represents all components instances we should send request to. // e.g: // 1. SELECT * FROM cluster_config WHERE instance='192.168.1.7:2379' // 2. SELECT * FROM cluster_config WHERE type in ('192.168.1.7:2379', '192.168.1.9:2379') Instances set.StringSet // contains filtered or unexported fields }
ClusterTableExtractor is used to extract some predicates of cluster table.
func (*ClusterTableExtractor) Extract ¶
func (e *ClusterTableExtractor) Extract(_ sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) []expression.Expression
Extract implements the MemTablePredicateExtractor Extract interface
type ColWithCmpFuncManager ¶
type ColWithCmpFuncManager struct { TargetCol *expression.Column OpType []string TmpConstant []*expression.Constant // contains filtered or unexported fields }
ColWithCmpFuncManager is used in index join to handle the column with compare functions(>=, >, <, <=). It stores the compare functions and build ranges in execution phase.
func (*ColWithCmpFuncManager) BuildRangesByRow ¶
func (cwc *ColWithCmpFuncManager) BuildRangesByRow(ctx sessionctx.Context, row chunk.Row) ([]*ranger.Range, error)
BuildRangesByRow will build range of the given row. It will eval each function's arg then call BuildRange.
func (*ColWithCmpFuncManager) CompareRow ¶
func (cwc *ColWithCmpFuncManager) CompareRow(lhs, rhs chunk.Row) int
CompareRow compares the rows for deduplicate.
func (*ColWithCmpFuncManager) String ¶
func (cwc *ColWithCmpFuncManager) String() string
String implements Stringer interface.
type DDL ¶
DDL represents a DDL statement plan.
func (*DDL) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*DDL) ResolveIndices ¶
func (p *DDL) ResolveIndices() (err error)
func (*DDL) Schema ¶
func (s *DDL) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*DDL) SetOutputNames ¶
func (*DDL) SetSchema ¶
func (s *DDL) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type DataSource ¶
type DataSource struct { Columns []*model.ColumnInfo DBName model.CIStr TableAsName *model.CIStr // TblCols contains the original columns of table before being pruned, and it // is used for estimating table scan cost. TblCols []*expression.Column // TblColHists contains the Histogram of all original table columns, // it is converted from statisticTable, and used for IO/network cost estimating. TblColHists *statistics.HistColl // contains filtered or unexported fields }
DataSource represents a tableScan without condition push down.
func (*DataSource) BuildKeyInfo ¶
func (ds *DataSource) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*DataSource) Convert2Gathers ¶
func (ds *DataSource) Convert2Gathers() (gathers []LogicalPlan)
Convert2Gathers builds logical TiKVSingleGathers from DataSource.
func (*DataSource) DeriveStats ¶
func (ds *DataSource) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*DataSource) ExplainInfo ¶
func (p *DataSource) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*DataSource) ExtractCorrelatedCols ¶
func (ds *DataSource) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (DataSource) Init ¶
func (ds DataSource) Init(ctx sessionctx.Context, offset int) *DataSource
Init initializes DataSource.
func (*DataSource) OutputNames ¶
func (*DataSource) PredicatePushDown ¶
func (ds *DataSource) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*DataSource) PreparePossibleProperties ¶
func (ds *DataSource) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*DataSource) PruneColumns ¶
func (ds *DataSource) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*DataSource) Schema ¶
func (s *DataSource) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*DataSource) SetOutputNames ¶
func (*DataSource) SetSchema ¶
func (s *DataSource) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
func (*DataSource) TableInfo ¶
func (ds *DataSource) TableInfo() *model.TableInfo
TableInfo returns the *TableInfo of data source.
type Deallocate ¶
type Deallocate struct { Name string // contains filtered or unexported fields }
Deallocate represents deallocate plan.
func (*Deallocate) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Deallocate) ResolveIndices ¶
func (p *Deallocate) ResolveIndices() (err error)
func (*Deallocate) Schema ¶
func (s *Deallocate) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Deallocate) SetOutputNames ¶
func (*Deallocate) SetSchema ¶
func (s *Deallocate) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Delete ¶
type Delete struct { IsMultiTable bool SelectPlan PhysicalPlan TblColPosInfos TblColPosInfoSlice // contains filtered or unexported fields }
Delete represents a delete plan.
func (*Delete) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Delete) ResolveIndices ¶
func (p *Delete) ResolveIndices() (err error)
func (*Delete) Schema ¶
func (s *Delete) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Delete) SetOutputNames ¶
func (*Delete) SetSchema ¶
func (s *Delete) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ErrExprLoc ¶
ErrExprLoc is for generate the ErrFieldNotInGroupBy error info
type Execute ¶
type Execute struct { Name string UsingVars []expression.Expression PrepareParams []types.Datum ExecID uint32 Stmt ast.StmtNode StmtType string Plan Plan // contains filtered or unexported fields }
Execute represents prepare plan.
func (*Execute) OptimizePreparedPlan ¶
func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema) error
OptimizePreparedPlan optimizes the prepared statement.
func (*Execute) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Execute) ResolveIndices ¶
func (p *Execute) ResolveIndices() (err error)
func (*Execute) Schema ¶
func (s *Execute) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Execute) SetOutputNames ¶
func (*Execute) SetSchema ¶
func (s *Execute) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Explain ¶
type Explain struct { TargetPlan Plan Format string Analyze bool ExecStmt ast.StmtNode Rows [][]string // contains filtered or unexported fields }
Explain represents a explain plan.
func (*Explain) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Explain) RenderResult ¶
RenderResult renders the explain result as specified format.
func (*Explain) ResolveIndices ¶
func (p *Explain) ResolveIndices() (err error)
func (*Explain) Schema ¶
func (s *Explain) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Explain) SetOutputNames ¶
func (*Explain) SetSchema ¶
func (s *Explain) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ExprColumnMap ¶
type ExprColumnMap map[expression.Expression]*expression.Column
ExprColumnMap is used to store all expressions of indexed generated columns in a table, and map them to the generated columns, thus we can substitute the expression in a query to an indexed generated column.
type FrameBound ¶
type FrameBound struct { Type ast.BoundType UnBounded bool Num uint64 // CalcFuncs is used for range framed windows. // We will build the date_add or date_sub functions for frames like `INTERVAL '2:30' MINUTE_SECOND FOLLOWING`, // and plus or minus for frames like `1 preceding`. CalcFuncs []expression.Expression // CmpFuncs is used to decide whether one row is included in the current frame. CmpFuncs []expression.CompareFunc }
FrameBound is the boundary of a frame.
type IndexAdvise ¶
type IndexAdvise struct { IsLocal bool Path string MaxMinutes uint64 MaxIndexNum *ast.MaxIndexNumClause LinesInfo *ast.LinesClause // contains filtered or unexported fields }
IndexAdvise represents a index advise plan.
func (*IndexAdvise) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*IndexAdvise) ResolveIndices ¶
func (p *IndexAdvise) ResolveIndices() (err error)
func (*IndexAdvise) Schema ¶
func (s *IndexAdvise) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*IndexAdvise) SetOutputNames ¶
func (*IndexAdvise) SetSchema ¶
func (s *IndexAdvise) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Insert ¶
type Insert struct { Table table.Table Columns []*ast.ColumnName Lists [][]expression.Expression SetList []*expression.Assignment OnDuplicate []*expression.Assignment Schema4OnDuplicate *expression.Schema GenCols InsertGeneratedColumns SelectPlan PhysicalPlan IsReplace bool // NeedFillDefaultValue is true when expr in value list reference other column. NeedFillDefaultValue bool AllAssignmentsAreConstant bool // contains filtered or unexported fields }
Insert represents an insert plan.
func (*Insert) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Insert) ResolveIndices ¶
ResolveIndices implements Plan interface.
func (*Insert) Schema ¶
func (s *Insert) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Insert) SetOutputNames ¶
func (*Insert) SetSchema ¶
func (s *Insert) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type InsertGeneratedColumns ¶
type InsertGeneratedColumns struct { Columns []*ast.ColumnName Exprs []expression.Expression OnDuplicates []*expression.Assignment }
InsertGeneratedColumns is for completing generated columns in Insert. We resolve generation expressions in plan, and eval those in executor.
type InspectionResultTableExtractor ¶
type InspectionResultTableExtractor struct { // SkipInspection means the where clause always false, we don't need to request any component SkipInspection bool // Rules represents rules applied to, and we should apply all inspection rules if there is no rules specified // e.g: SELECT * FROM inspection_result WHERE rule in ('ddl', 'config') Rules set.StringSet // Items represents items applied to, and we should apply all inspection item if there is no rules specified // e.g: SELECT * FROM inspection_result WHERE item in ('ddl.lease', 'raftstore.threadpool') Items set.StringSet // contains filtered or unexported fields }
InspectionResultTableExtractor is used to extract some predicates of `inspection_result`
func (*InspectionResultTableExtractor) Extract ¶
func (e *InspectionResultTableExtractor) Extract( _ sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) (remained []expression.Expression)
Extract implements the MemTablePredicateExtractor Extract interface
type InspectionRuleTableExtractor ¶
type InspectionRuleTableExtractor struct { SkipRequest bool Types set.StringSet // contains filtered or unexported fields }
InspectionRuleTableExtractor is used to extract some predicates of `inspection_rules`
func (*InspectionRuleTableExtractor) Extract ¶
func (e *InspectionRuleTableExtractor) Extract( _ sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) (remained []expression.Expression)
Extract implements the MemTablePredicateExtractor Extract interface
type InspectionSummaryTableExtractor ¶
type InspectionSummaryTableExtractor struct { // SkipInspection means the where clause always false, we don't need to request any component SkipInspection bool // Rules represents rules applied to, and we should apply all inspection rules if there is no rules specified // e.g: SELECT * FROM inspection_summary WHERE rule in ('ddl', 'config') Rules set.StringSet MetricNames set.StringSet Quantiles []float64 // contains filtered or unexported fields }
InspectionSummaryTableExtractor is used to extract some predicates of `inspection_summary`
func (*InspectionSummaryTableExtractor) Extract ¶
func (e *InspectionSummaryTableExtractor) Extract( _ sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) (remained []expression.Expression)
Extract implements the MemTablePredicateExtractor Extract interface
type JoinType ¶
type JoinType int
JoinType contains CrossJoin, InnerJoin, LeftOuterJoin, RightOuterJoin, FullOuterJoin, SemiJoin.
const ( // InnerJoin means inner join. InnerJoin JoinType = iota // LeftOuterJoin means left join. LeftOuterJoin // RightOuterJoin means right join. RightOuterJoin // SemiJoin means if row a in table A matches some rows in B, just output a. SemiJoin // AntiSemiJoin means if row a in table A does not match any row in B, then output a. AntiSemiJoin // LeftOuterSemiJoin means if row a in table A matches some rows in B, output (a, true), otherwise, output (a, false). LeftOuterSemiJoin // AntiLeftOuterSemiJoin means if row a in table A matches some rows in B, output (a, false), otherwise, output (a, true). AntiLeftOuterSemiJoin )
func (JoinType) IsOuterJoin ¶
IsOuterJoin returns if this joiner is a outer joiner
type LoadData ¶
type LoadData struct { IsLocal bool OnDuplicate ast.OnDuplicateKeyHandlingType Path string Table *ast.TableName Columns []*ast.ColumnName FieldsInfo *ast.FieldsClause LinesInfo *ast.LinesClause IgnoreLines uint64 GenCols InsertGeneratedColumns // contains filtered or unexported fields }
LoadData represents a loaddata plan.
func (*LoadData) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*LoadData) ResolveIndices ¶
func (p *LoadData) ResolveIndices() (err error)
func (*LoadData) Schema ¶
func (s *LoadData) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LoadData) SetOutputNames ¶
func (*LoadData) SetSchema ¶
func (s *LoadData) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LoadStats ¶
type LoadStats struct { Path string // contains filtered or unexported fields }
LoadStats represents a load stats plan.
func (*LoadStats) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*LoadStats) ResolveIndices ¶
func (p *LoadStats) ResolveIndices() (err error)
func (*LoadStats) Schema ¶
func (s *LoadStats) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LoadStats) SetOutputNames ¶
func (*LoadStats) SetSchema ¶
func (s *LoadStats) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalAggregation ¶
type LogicalAggregation struct { AggFuncs []*aggregation.AggFuncDesc GroupByItems []expression.Expression // contains filtered or unexported fields }
LogicalAggregation represents an aggregate plan.
func (*LogicalAggregation) BuildKeyInfo ¶
func (la *LogicalAggregation) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalAggregation) CopyAggHints ¶
func (la *LogicalAggregation) CopyAggHints(agg *LogicalAggregation)
CopyAggHints copies the aggHints from another LogicalAggregation.
func (*LogicalAggregation) DeriveStats ¶
func (la *LogicalAggregation) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalAggregation) ExplainInfo ¶
func (p *LogicalAggregation) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalAggregation) ExtractCorrelatedCols ¶
func (la *LogicalAggregation) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalAggregation) GetGroupByCols ¶
func (la *LogicalAggregation) GetGroupByCols() []*expression.Column
GetGroupByCols returns the groupByCols. If the groupByCols haven't be collected, this method would collect them at first. If the GroupByItems have been changed, we should explicitly collect GroupByColumns before this method.
func (*LogicalAggregation) GetUsedCols ¶
func (la *LogicalAggregation) GetUsedCols() (usedCols []*expression.Column)
GetUsedCols extracts all of the Columns used by agg including GroupByItems and AggFuncs.
func (*LogicalAggregation) HasDistinct ¶
func (la *LogicalAggregation) HasDistinct() bool
HasDistinct shows whether LogicalAggregation has functions with distinct.
func (LogicalAggregation) Init ¶
func (la LogicalAggregation) Init(ctx sessionctx.Context, offset int) *LogicalAggregation
Init initializes LogicalAggregation.
func (*LogicalAggregation) IsCompleteModeAgg ¶
func (la *LogicalAggregation) IsCompleteModeAgg() bool
IsCompleteModeAgg returns if all of the AggFuncs are CompleteMode.
func (*LogicalAggregation) IsPartialModeAgg ¶
func (la *LogicalAggregation) IsPartialModeAgg() bool
IsPartialModeAgg returns if all of the AggFuncs are partialMode.
func (*LogicalAggregation) OutputNames ¶
func (*LogicalAggregation) PredicatePushDown ¶
func (la *LogicalAggregation) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalAggregation) PreparePossibleProperties ¶
func (la *LogicalAggregation) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalAggregation) PruneColumns ¶
func (la *LogicalAggregation) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalAggregation) ResetHintIfConflicted ¶
func (la *LogicalAggregation) ResetHintIfConflicted() (preferHash bool, preferStream bool)
ResetHintIfConflicted resets the aggHints.preferAggType if they are conflicted, and returns the two preferAggType hints.
func (*LogicalAggregation) Schema ¶
func (s *LogicalAggregation) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalAggregation) SetOutputNames ¶
func (*LogicalAggregation) SetSchema ¶
func (s *LogicalAggregation) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalApply ¶
type LogicalApply struct { LogicalJoin CorCols []*expression.CorrelatedColumn }
LogicalApply gets one row from outer executor and gets one row from inner executor according to outer row.
func (*LogicalApply) DeriveStats ¶
func (la *LogicalApply) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalApply) ExplainInfo ¶
func (p *LogicalApply) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalApply) ExtractCorrelatedCols ¶
func (la *LogicalApply) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalApply) GetHashJoin ¶
func (la *LogicalApply) GetHashJoin(prop *property.PhysicalProperty) *PhysicalHashJoin
GetHashJoin is public for cascades planner.
func (LogicalApply) Init ¶
func (la LogicalApply) Init(ctx sessionctx.Context, offset int) *LogicalApply
Init initializes LogicalApply.
func (*LogicalApply) OutputNames ¶
func (*LogicalApply) PruneColumns ¶
func (la *LogicalApply) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalApply) Schema ¶
func (s *LogicalApply) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalApply) SetOutputNames ¶
func (*LogicalApply) SetSchema ¶
func (s *LogicalApply) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalIndexScan ¶
type LogicalIndexScan struct { // DataSource should be read-only here. Source *DataSource IsDoubleRead bool EqCondCount int AccessConds expression.CNFExprs Ranges []*ranger.Range Index *model.IndexInfo Columns []*model.ColumnInfo FullIdxCols []*expression.Column FullIdxColLens []int IdxCols []*expression.Column IdxColLens []int // contains filtered or unexported fields }
LogicalIndexScan is the logical index scan operator for TiKV.
func (*LogicalIndexScan) BuildKeyInfo ¶
func (is *LogicalIndexScan) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalIndexScan) DeriveStats ¶
func (is *LogicalIndexScan) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implements LogicalPlan DeriveStats interface.
func (*LogicalIndexScan) ExplainInfo ¶
func (p *LogicalIndexScan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalIndexScan) GetPhysicalIndexScan ¶
func (s *LogicalIndexScan) GetPhysicalIndexScan(schema *expression.Schema, stats *property.StatsInfo) *PhysicalIndexScan
GetPhysicalIndexScan returns PhysicalIndexScan for the logical IndexScan.
func (LogicalIndexScan) Init ¶
func (is LogicalIndexScan) Init(ctx sessionctx.Context, offset int) *LogicalIndexScan
Init initializes LogicalIndexScan.
func (*LogicalIndexScan) MatchIndexProp ¶
func (p *LogicalIndexScan) MatchIndexProp(prop *property.PhysicalProperty) (match bool)
MatchIndexProp checks if the indexScan can match the required property.
func (*LogicalIndexScan) OutputNames ¶
func (*LogicalIndexScan) PreparePossibleProperties ¶
func (is *LogicalIndexScan) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalIndexScan) Schema ¶
func (s *LogicalIndexScan) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalIndexScan) SetOutputNames ¶
func (*LogicalIndexScan) SetSchema ¶
func (s *LogicalIndexScan) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalJoin ¶
type LogicalJoin struct { JoinType JoinType StraightJoin bool EqualConditions []*expression.ScalarFunction LeftConditions expression.CNFExprs RightConditions expression.CNFExprs OtherConditions expression.CNFExprs // DefaultValues is only used for left/right outer join, which is values the inner row's should be when the outer table // doesn't match any inner table's row. // That it's nil just means the default values is a slice of NULL. // Currently, only `aggregation push down` phase will set this. DefaultValues []types.Datum // contains filtered or unexported fields }
LogicalJoin is the logical join plan.
func (*LogicalJoin) AppendJoinConds ¶
func (p *LogicalJoin) AppendJoinConds(eq []*expression.ScalarFunction, left, right, other []expression.Expression)
AppendJoinConds appends new join conditions.
func (*LogicalJoin) AttachOnConds ¶
func (p *LogicalJoin) AttachOnConds(onConds []expression.Expression)
AttachOnConds extracts on conditions for join and set the `EqualConditions`, `LeftConditions`, `RightConditions` and `OtherConditions` by the result of extract.
func (*LogicalJoin) BuildKeyInfo ¶
func (p *LogicalJoin) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalJoin) DeriveStats ¶
func (p *LogicalJoin) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface. If the type of join is SemiJoin, the selectivity of it will be same as selection's. If the type of join is LeftOuterSemiJoin, it will not add or remove any row. The last column is a boolean value, whose Cardinality should be two. If the type of join is inner/outer join, the output of join(s, t) should be N(s) * N(t) / (V(s.key) * V(t.key)) * Min(s.key, t.key). N(s) stands for the number of rows in relation s. V(s.key) means the Cardinality of join key in s. This is a quite simple strategy: We assume every bucket of relation which will participate join has the same number of rows, and apply cross join for every matched bucket.
func (*LogicalJoin) ExplainInfo ¶
func (p *LogicalJoin) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalJoin) ExtractCorrelatedCols ¶
func (p *LogicalJoin) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalJoin) ExtractJoinKeys ¶
func (p *LogicalJoin) ExtractJoinKeys(childIdx int) *expression.Schema
ExtractJoinKeys extract join keys as a schema for child with childIdx.
func (*LogicalJoin) ExtractOnCondition ¶
func (p *LogicalJoin) ExtractOnCondition( conditions []expression.Expression, leftSchema *expression.Schema, rightSchema *expression.Schema, deriveLeft bool, deriveRight bool) (eqCond []*expression.ScalarFunction, leftCond []expression.Expression, rightCond []expression.Expression, otherCond []expression.Expression)
ExtractOnCondition divide conditions in CNF of join node into 4 groups. These conditions can be where conditions, join conditions, or collection of both. If deriveLeft/deriveRight is set, we would try to derive more conditions for left/right plan.
func (*LogicalJoin) GetJoinKeys ¶
func (p *LogicalJoin) GetJoinKeys() (leftKeys, rightKeys []*expression.Column)
GetJoinKeys extracts join keys(columns) from EqualConditions.
func (*LogicalJoin) GetMergeJoin ¶
func (p *LogicalJoin) GetMergeJoin(prop *property.PhysicalProperty, schema *expression.Schema, statsInfo *property.StatsInfo, leftStatsInfo *property.StatsInfo, rightStatsInfo *property.StatsInfo) []PhysicalPlan
GetMergeJoin convert the logical join to physical merge join based on the physical property.
func (LogicalJoin) Init ¶
func (p LogicalJoin) Init(ctx sessionctx.Context, offset int) *LogicalJoin
Init initializes LogicalJoin.
func (*LogicalJoin) OutputNames ¶
func (*LogicalJoin) PredicatePushDown ¶
func (p *LogicalJoin) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalJoin) PreparePossibleProperties ¶
func (p *LogicalJoin) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalJoin) PruneColumns ¶
func (p *LogicalJoin) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalJoin) Schema ¶
func (s *LogicalJoin) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalJoin) SetOutputNames ¶
func (*LogicalJoin) SetSchema ¶
func (s *LogicalJoin) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
func (*LogicalJoin) Shallow ¶
func (p *LogicalJoin) Shallow() *LogicalJoin
Shallow shallow copies a LogicalJoin struct.
type LogicalLimit ¶
LogicalLimit represents offset and limit plan.
func (*LogicalLimit) BuildKeyInfo ¶
func (p *LogicalLimit) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalLimit) Children ¶
func (p *LogicalLimit) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalLimit) DeriveStats ¶
func (p *LogicalLimit) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalLimit) ExplainInfo ¶
func (p *LogicalLimit) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalLimit) ExtractCorrelatedCols ¶
func (p *LogicalLimit) ExtractCorrelatedCols() []*expression.CorrelatedColumn
func (*LogicalLimit) HashCode ¶
func (p *LogicalLimit) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalLimit) Init ¶
func (p LogicalLimit) Init(ctx sessionctx.Context, offset int) *LogicalLimit
Init initializes LogicalLimit.
func (*LogicalLimit) OutputNames ¶
func (*LogicalLimit) PredicatePushDown ¶
func (p *LogicalLimit) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalLimit) PreparePossibleProperties ¶
func (p *LogicalLimit) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalLimit) PruneColumns ¶
func (p *LogicalLimit) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalLimit) Schema ¶
func (p *LogicalLimit) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*LogicalLimit) SetChild ¶
func (p *LogicalLimit) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalLimit) SetChildren ¶
func (p *LogicalLimit) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalLimit) SetOutputNames ¶
type LogicalLock ¶
type LogicalLock struct { Lock ast.SelectLockType // contains filtered or unexported fields }
LogicalLock represents a select lock plan.
func (*LogicalLock) BuildKeyInfo ¶
func (p *LogicalLock) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalLock) Children ¶
func (p *LogicalLock) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalLock) DeriveStats ¶
func (p *LogicalLock) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalLock) ExplainInfo ¶
func (p *LogicalLock) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalLock) ExtractCorrelatedCols ¶
func (p *LogicalLock) ExtractCorrelatedCols() []*expression.CorrelatedColumn
func (*LogicalLock) HashCode ¶
func (p *LogicalLock) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalLock) Init ¶
func (p LogicalLock) Init(ctx sessionctx.Context) *LogicalLock
Init initializes LogicalLock.
func (*LogicalLock) OutputNames ¶
func (*LogicalLock) PredicatePushDown ¶
func (p *LogicalLock) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan interface.
func (*LogicalLock) PreparePossibleProperties ¶
func (p *LogicalLock) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalLock) PruneColumns ¶
func (p *LogicalLock) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalLock) Schema ¶
func (p *LogicalLock) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*LogicalLock) SetChild ¶
func (p *LogicalLock) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalLock) SetChildren ¶
func (p *LogicalLock) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalLock) SetOutputNames ¶
type LogicalMaxOneRow ¶
type LogicalMaxOneRow struct {
// contains filtered or unexported fields
}
LogicalMaxOneRow checks if a query returns no more than one row.
func (*LogicalMaxOneRow) BuildKeyInfo ¶
func (p *LogicalMaxOneRow) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalMaxOneRow) Children ¶
func (p *LogicalMaxOneRow) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalMaxOneRow) DeriveStats ¶
func (p *LogicalMaxOneRow) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalMaxOneRow) ExplainInfo ¶
func (p *LogicalMaxOneRow) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalMaxOneRow) ExtractCorrelatedCols ¶
func (p *LogicalMaxOneRow) ExtractCorrelatedCols() []*expression.CorrelatedColumn
func (*LogicalMaxOneRow) HashCode ¶
func (p *LogicalMaxOneRow) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalMaxOneRow) Init ¶
func (p LogicalMaxOneRow) Init(ctx sessionctx.Context, offset int) *LogicalMaxOneRow
Init initializes LogicalMaxOneRow.
func (*LogicalMaxOneRow) OutputNames ¶
func (*LogicalMaxOneRow) PredicatePushDown ¶
func (p *LogicalMaxOneRow) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalMaxOneRow) PreparePossibleProperties ¶
func (p *LogicalMaxOneRow) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalMaxOneRow) PruneColumns ¶
func (p *LogicalMaxOneRow) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalMaxOneRow) Schema ¶
func (p *LogicalMaxOneRow) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalMaxOneRow) SetChild ¶
func (p *LogicalMaxOneRow) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalMaxOneRow) SetChildren ¶
func (p *LogicalMaxOneRow) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalMaxOneRow) SetOutputNames ¶
type LogicalMemTable ¶
type LogicalMemTable struct { Extractor MemTablePredicateExtractor DBName model.CIStr TableInfo *model.TableInfo // QueryTimeRange is used to specify the time range for metrics summary tables and inspection tables // e.g: select /*+ time_range('2020-02-02 12:10:00', '2020-02-02 13:00:00') */ from metrics_summary; // select /*+ time_range('2020-02-02 12:10:00', '2020-02-02 13:00:00') */ from metrics_summary_by_label; // select /*+ time_range('2020-02-02 12:10:00', '2020-02-02 13:00:00') */ from inspection_summary; // select /*+ time_range('2020-02-02 12:10:00', '2020-02-02 13:00:00') */ from inspection_result; QueryTimeRange QueryTimeRange // contains filtered or unexported fields }
LogicalMemTable represents a memory table or virtual table Some memory tables wants to take the ownership of some predications e.g SELECT * FROM cluster_log WHERE type='tikv' AND address='192.16.5.32' Assume that the table `cluster_log` is a memory table, which is used to retrieve logs from remote components. In the above situation we should send log search request to the target TiKV (192.16.5.32) directly instead of requesting all cluster components log search gRPC interface to retrieve log message and filtering them in TiDB node.
func (*LogicalMemTable) BuildKeyInfo ¶
func (p *LogicalMemTable) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalMemTable) DeriveStats ¶
func (p *LogicalMemTable) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (LogicalMemTable) Init ¶
func (p LogicalMemTable) Init(ctx sessionctx.Context, offset int) *LogicalMemTable
Init initializes LogicalMemTable.
func (*LogicalMemTable) OutputNames ¶
func (*LogicalMemTable) PredicatePushDown ¶
func (p *LogicalMemTable) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalMemTable) Schema ¶
func (s *LogicalMemTable) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalMemTable) SetOutputNames ¶
func (*LogicalMemTable) SetSchema ¶
func (s *LogicalMemTable) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalPlan ¶
type LogicalPlan interface { Plan // HashCode encodes a LogicalPlan to fast compare whether a LogicalPlan equals to another. // We use a strict encode method here which ensures there is no conflict. HashCode() []byte // PredicatePushDown pushes down the predicates in the where/on/having clauses as deeply as possible. // It will accept a predicate that is an expression slice, and return the expressions that can't be pushed. // Because it might change the root if the having clause exists, we need to return a plan that represents a new root. PredicatePushDown([]expression.Expression) ([]expression.Expression, LogicalPlan) // PruneColumns prunes the unused columns. PruneColumns([]*expression.Column) error // BuildKeyInfo will collect the information of unique keys into schema. // Because this method is also used in cascades planner, we cannot use // things like `p.schema` or `p.children` inside it. We should use the `selfSchema` // and `childSchema` instead. BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema) // DeriveStats derives statistic info for current plan node given child stats. // We need selfSchema, childSchema here because it makes this method can be used in // cascades planner, where LogicalPlan might not record its children or schema. DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error) // PreparePossibleProperties is only used for join and aggregation. Like group by a,b,c, all permutation of (a,b,c) is // valid, but the ordered indices in leaf plan is limited. So we can get all possible order properties by a pre-walking. PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column ExtractCorrelatedCols() []*expression.CorrelatedColumn // MaxOneRow means whether this operator only returns max one row. MaxOneRow() bool // Get all the children. Children() []LogicalPlan // SetChildren sets the children for the plan. SetChildren(...LogicalPlan) // SetChild sets the ith child for the plan. SetChild(i int, child LogicalPlan) // contains filtered or unexported methods }
LogicalPlan is a tree of logical operators. We can do a lot of logical optimizations to it, like predicate pushdown and column pruning.
func Conds2TableDual ¶
func Conds2TableDual(p LogicalPlan, conds []expression.Expression) LogicalPlan
Conds2TableDual builds a LogicalTableDual if cond is constant false or null.
type LogicalProjection ¶
type LogicalProjection struct { Exprs []expression.Expression // CalculateNoDelay indicates this Projection is the root Plan and should be // calculated without delay and will not return any result to client. // Currently it is "true" only when the current sql query is a "DO" statement. // See "https://dev.mysql.com/doc/refman/5.7/en/do.html" for more detail. CalculateNoDelay bool // AvoidColumnEvaluator is a temporary variable which is ONLY used to avoid // building columnEvaluator for the expressions of Projection which is // built by buildProjection4Union. // This can be removed after column pool being supported. // Related issue: TiDB#8141(https://github.com/pingcap/tidb/issues/8141) AvoidColumnEvaluator bool // contains filtered or unexported fields }
LogicalProjection represents a select fields plan.
func ConvertAggToProj ¶
func ConvertAggToProj(agg *LogicalAggregation, schema *expression.Schema) (bool, *LogicalProjection)
ConvertAggToProj convert aggregation to projection.
func (*LogicalProjection) BuildKeyInfo ¶
func (p *LogicalProjection) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalProjection) DeriveStats ¶
func (p *LogicalProjection) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalProjection) ExplainInfo ¶
func (p *LogicalProjection) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalProjection) ExtractCorrelatedCols ¶
func (p *LogicalProjection) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalProjection) GetUsedCols ¶
func (p *LogicalProjection) GetUsedCols() (usedCols []*expression.Column)
GetUsedCols extracts all of the Columns used by proj.
func (*LogicalProjection) HashCode ¶
func (p *LogicalProjection) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalProjection) Init ¶
func (p LogicalProjection) Init(ctx sessionctx.Context, offset int) *LogicalProjection
Init initializes LogicalProjection.
func (*LogicalProjection) OutputNames ¶
func (*LogicalProjection) PredicatePushDown ¶
func (p *LogicalProjection) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalProjection) PreparePossibleProperties ¶
func (p *LogicalProjection) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalProjection) PruneColumns ¶
func (p *LogicalProjection) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface. If any expression has SetVar function or Sleep function, we do not prune it.
func (*LogicalProjection) Schema ¶
func (s *LogicalProjection) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalProjection) SetOutputNames ¶
func (*LogicalProjection) SetSchema ¶
func (s *LogicalProjection) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
func (*LogicalProjection) TryToGetChildProp ¶
func (p *LogicalProjection) TryToGetChildProp(prop *property.PhysicalProperty) (*property.PhysicalProperty, bool)
TryToGetChildProp will check if this sort property can be pushed or not. When a sort column will be replaced by scalar function, we refuse it. When a sort column will be replaced by a constant, we just remove it.
type LogicalSelection ¶
type LogicalSelection struct { // Originally the WHERE or ON condition is parsed into a single expression, // but after we converted to CNF(Conjunctive normal form), it can be // split into a list of AND conditions. Conditions []expression.Expression // contains filtered or unexported fields }
LogicalSelection represents a where or having predicate.
func (*LogicalSelection) BuildKeyInfo ¶
func (p *LogicalSelection) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalSelection) Children ¶
func (p *LogicalSelection) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalSelection) DeriveStats ¶
func (p *LogicalSelection) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalSelection) ExplainInfo ¶
func (p *LogicalSelection) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalSelection) ExtractCorrelatedCols ¶
func (p *LogicalSelection) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalSelection) HashCode ¶
func (p *LogicalSelection) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalSelection) Init ¶
func (p LogicalSelection) Init(ctx sessionctx.Context, offset int) *LogicalSelection
Init initializes LogicalSelection.
func (*LogicalSelection) OutputNames ¶
func (*LogicalSelection) PredicatePushDown ¶
func (p *LogicalSelection) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalSelection) PreparePossibleProperties ¶
func (p *LogicalSelection) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalSelection) PruneColumns ¶
func (p *LogicalSelection) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalSelection) Schema ¶
func (p *LogicalSelection) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*LogicalSelection) SetChild ¶
func (p *LogicalSelection) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalSelection) SetChildren ¶
func (p *LogicalSelection) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalSelection) SetOutputNames ¶
type LogicalShow ¶
type LogicalShow struct { ShowContents // contains filtered or unexported fields }
LogicalShow represents a show plan.
func (*LogicalShow) BuildKeyInfo ¶
func (p *LogicalShow) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalShow) DeriveStats ¶
func (p *LogicalShow) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (LogicalShow) Init ¶
func (p LogicalShow) Init(ctx sessionctx.Context) *LogicalShow
Init initializes LogicalShow.
func (*LogicalShow) OutputNames ¶
func (*LogicalShow) Schema ¶
func (s *LogicalShow) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalShow) SetOutputNames ¶
func (*LogicalShow) SetSchema ¶
func (s *LogicalShow) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalShowDDLJobs ¶
type LogicalShowDDLJobs struct { JobNumber int64 // contains filtered or unexported fields }
LogicalShowDDLJobs is for showing DDL job list.
func (*LogicalShowDDLJobs) BuildKeyInfo ¶
func (p *LogicalShowDDLJobs) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalShowDDLJobs) DeriveStats ¶
func (p *LogicalShowDDLJobs) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (LogicalShowDDLJobs) Init ¶
func (p LogicalShowDDLJobs) Init(ctx sessionctx.Context) *LogicalShowDDLJobs
Init initializes LogicalShowDDLJobs.
func (*LogicalShowDDLJobs) OutputNames ¶
func (*LogicalShowDDLJobs) Schema ¶
func (s *LogicalShowDDLJobs) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalShowDDLJobs) SetOutputNames ¶
func (*LogicalShowDDLJobs) SetSchema ¶
func (s *LogicalShowDDLJobs) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalSort ¶
type LogicalSort struct { ByItems []*ByItems // contains filtered or unexported fields }
LogicalSort stands for the order by plan.
func (*LogicalSort) BuildKeyInfo ¶
func (p *LogicalSort) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalSort) Children ¶
func (p *LogicalSort) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalSort) DeriveStats ¶
func (p *LogicalSort) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalSort) ExplainInfo ¶
func (p *LogicalSort) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalSort) ExtractCorrelatedCols ¶
func (ls *LogicalSort) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalSort) HashCode ¶
func (p *LogicalSort) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalSort) Init ¶
func (ls LogicalSort) Init(ctx sessionctx.Context, offset int) *LogicalSort
Init initializes LogicalSort.
func (*LogicalSort) OutputNames ¶
func (*LogicalSort) PredicatePushDown ¶
func (p *LogicalSort) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan interface.
func (*LogicalSort) PreparePossibleProperties ¶
func (p *LogicalSort) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalSort) PruneColumns ¶
func (ls *LogicalSort) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface. If any expression can view as a constant in execution stage, such as correlated column, constant, we do prune them. Note that we can't prune the expressions contain non-deterministic functions, such as rand().
func (*LogicalSort) Schema ¶
func (p *LogicalSort) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*LogicalSort) SetChild ¶
func (p *LogicalSort) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalSort) SetChildren ¶
func (p *LogicalSort) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalSort) SetOutputNames ¶
type LogicalTableDual ¶
type LogicalTableDual struct { RowCount int // contains filtered or unexported fields }
LogicalTableDual represents a dual table plan.
func (*LogicalTableDual) BuildKeyInfo ¶
func (p *LogicalTableDual) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalTableDual) DeriveStats ¶
func (p *LogicalTableDual) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalTableDual) ExplainInfo ¶
func (p *LogicalTableDual) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalTableDual) HashCode ¶
func (p *LogicalTableDual) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalTableDual) Init ¶
func (p LogicalTableDual) Init(ctx sessionctx.Context, offset int) *LogicalTableDual
Init initializes LogicalTableDual.
func (*LogicalTableDual) OutputNames ¶
func (*LogicalTableDual) PredicatePushDown ¶
func (p *LogicalTableDual) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalTableDual) PruneColumns ¶
func (p *LogicalTableDual) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalTableDual) Schema ¶
func (s *LogicalTableDual) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalTableDual) SetOutputNames ¶
func (*LogicalTableDual) SetSchema ¶
func (s *LogicalTableDual) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalTableScan ¶
type LogicalTableScan struct { Source *DataSource Handle *expression.Column AccessConds expression.CNFExprs Ranges []*ranger.Range // contains filtered or unexported fields }
LogicalTableScan is the logical table scan operator for TiKV.
func (*LogicalTableScan) BuildKeyInfo ¶
func (ts *LogicalTableScan) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalTableScan) DeriveStats ¶
func (ts *LogicalTableScan) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (_ *property.StatsInfo, err error)
DeriveStats implements LogicalPlan DeriveStats interface.
func (*LogicalTableScan) ExplainInfo ¶
func (p *LogicalTableScan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalTableScan) GetPhysicalScan ¶
func (s *LogicalTableScan) GetPhysicalScan(schema *expression.Schema, stats *property.StatsInfo) *PhysicalTableScan
GetPhysicalScan returns PhysicalTableScan for the LogicalTableScan.
func (LogicalTableScan) Init ¶
func (ts LogicalTableScan) Init(ctx sessionctx.Context, offset int) *LogicalTableScan
Init initializes LogicalTableScan.
func (*LogicalTableScan) OutputNames ¶
func (*LogicalTableScan) PreparePossibleProperties ¶
func (ts *LogicalTableScan) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalTableScan) Schema ¶
func (s *LogicalTableScan) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalTableScan) SetOutputNames ¶
func (*LogicalTableScan) SetSchema ¶
func (s *LogicalTableScan) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalTopN ¶
type LogicalTopN struct { ByItems []*ByItems Offset uint64 Count uint64 // contains filtered or unexported fields }
LogicalTopN represents a top-n plan.
func (*LogicalTopN) BuildKeyInfo ¶
func (p *LogicalTopN) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalTopN) Children ¶
func (p *LogicalTopN) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalTopN) DeriveStats ¶
func (lt *LogicalTopN) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalTopN) ExplainInfo ¶
func (p *LogicalTopN) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalTopN) ExtractCorrelatedCols ¶
func (lt *LogicalTopN) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalTopN) HashCode ¶
func (p *LogicalTopN) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalTopN) Init ¶
func (lt LogicalTopN) Init(ctx sessionctx.Context, offset int) *LogicalTopN
Init initializes LogicalTopN.
func (*LogicalTopN) OutputNames ¶
func (*LogicalTopN) PredicatePushDown ¶
func (p *LogicalTopN) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan interface.
func (*LogicalTopN) PreparePossibleProperties ¶
func (p *LogicalTopN) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalTopN) PruneColumns ¶
func (lt *LogicalTopN) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface. If any expression can view as a constant in execution stage, such as correlated column, constant, we do prune them. Note that we can't prune the expressions contain non-deterministic functions, such as rand().
func (*LogicalTopN) Schema ¶
func (p *LogicalTopN) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*LogicalTopN) SetChild ¶
func (p *LogicalTopN) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalTopN) SetChildren ¶
func (p *LogicalTopN) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalTopN) SetOutputNames ¶
type LogicalUnionAll ¶
type LogicalUnionAll struct {
// contains filtered or unexported fields
}
LogicalUnionAll represents LogicalUnionAll plan.
func (*LogicalUnionAll) BuildKeyInfo ¶
func (p *LogicalUnionAll) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalUnionAll) DeriveStats ¶
func (p *LogicalUnionAll) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (LogicalUnionAll) Init ¶
func (p LogicalUnionAll) Init(ctx sessionctx.Context, offset int) *LogicalUnionAll
Init initializes LogicalUnionAll.
func (*LogicalUnionAll) OutputNames ¶
func (*LogicalUnionAll) PredicatePushDown ¶
func (p *LogicalUnionAll) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalUnionAll) PruneColumns ¶
func (p *LogicalUnionAll) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalUnionAll) Schema ¶
func (s *LogicalUnionAll) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalUnionAll) SetOutputNames ¶
func (*LogicalUnionAll) SetSchema ¶
func (s *LogicalUnionAll) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type LogicalUnionScan ¶
type LogicalUnionScan struct {
// contains filtered or unexported fields
}
LogicalUnionScan is only used in non read-only txn.
func (*LogicalUnionScan) BuildKeyInfo ¶
func (p *LogicalUnionScan) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalUnionScan) Children ¶
func (p *LogicalUnionScan) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalUnionScan) DeriveStats ¶
func (p *LogicalUnionScan) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalUnionScan) ExplainInfo ¶
func (p *LogicalUnionScan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*LogicalUnionScan) ExtractCorrelatedCols ¶
func (p *LogicalUnionScan) ExtractCorrelatedCols() []*expression.CorrelatedColumn
func (*LogicalUnionScan) HashCode ¶
func (p *LogicalUnionScan) HashCode() []byte
HashCode implements LogicalPlan interface.
func (LogicalUnionScan) Init ¶
func (p LogicalUnionScan) Init(ctx sessionctx.Context, offset int) *LogicalUnionScan
Init initializes LogicalUnionScan.
func (*LogicalUnionScan) OutputNames ¶
func (*LogicalUnionScan) PredicatePushDown ¶
func (p *LogicalUnionScan) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalUnionScan) PreparePossibleProperties ¶
func (p *LogicalUnionScan) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalUnionScan) PruneColumns ¶
func (p *LogicalUnionScan) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalUnionScan) Schema ¶
func (p *LogicalUnionScan) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*LogicalUnionScan) SetChild ¶
func (p *LogicalUnionScan) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalUnionScan) SetChildren ¶
func (p *LogicalUnionScan) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
func (*LogicalUnionScan) SetOutputNames ¶
type LogicalWindow ¶
type LogicalWindow struct { WindowFuncDescs []*aggregation.WindowFuncDesc PartitionBy []property.Item OrderBy []property.Item Frame *WindowFrame // contains filtered or unexported fields }
LogicalWindow represents a logical window function plan.
func (*LogicalWindow) BuildKeyInfo ¶
func (p *LogicalWindow) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*LogicalWindow) DeriveStats ¶
func (p *LogicalWindow) DeriveStats(childStats []*property.StatsInfo, selfSchema *expression.Schema, childSchema []*expression.Schema) (*property.StatsInfo, error)
DeriveStats implement LogicalPlan DeriveStats interface.
func (*LogicalWindow) ExtractCorrelatedCols ¶
func (p *LogicalWindow) ExtractCorrelatedCols() []*expression.CorrelatedColumn
ExtractCorrelatedCols implements LogicalPlan interface.
func (*LogicalWindow) GetPartitionByCols ¶
func (p *LogicalWindow) GetPartitionByCols() []*expression.Column
GetPartitionByCols extracts 'partition by' columns from the Window.
func (*LogicalWindow) GetWindowResultColumns ¶
func (p *LogicalWindow) GetWindowResultColumns() []*expression.Column
GetWindowResultColumns returns the columns storing the result of the window function.
func (LogicalWindow) Init ¶
func (p LogicalWindow) Init(ctx sessionctx.Context, offset int) *LogicalWindow
Init initializes LogicalWindow.
func (*LogicalWindow) OutputNames ¶
func (*LogicalWindow) PredicatePushDown ¶
func (p *LogicalWindow) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan)
PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (*LogicalWindow) PreparePossibleProperties ¶
func (p *LogicalWindow) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*LogicalWindow) PruneColumns ¶
func (p *LogicalWindow) PruneColumns(parentUsedCols []*expression.Column) error
PruneColumns implements LogicalPlan interface.
func (*LogicalWindow) Schema ¶
func (s *LogicalWindow) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*LogicalWindow) SetOutputNames ¶
func (*LogicalWindow) SetSchema ¶
func (s *LogicalWindow) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type MemTablePredicateExtractor ¶
type MemTablePredicateExtractor interface { // Extracts predicates which can be pushed down and returns the remained predicates Extract(sessionctx.Context, *expression.Schema, []*types.FieldName, []expression.Expression) (remained []expression.Expression) // contains filtered or unexported methods }
MemTablePredicateExtractor is used to extract some predicates from `WHERE` clause and push the predicates down to the data retrieving on reading memory table stage.
e.g: SELECT * FROM cluster_config WHERE type='tikv' AND instance='192.168.1.9:2379' We must request all components in the cluster via HTTP API for retrieving configurations and filter them by `type/instance` columns.
The purpose of defining a `MemTablePredicateExtractor` is to optimize this 1. Define a `ClusterConfigTablePredicateExtractor` 2. Extract the `type/instance` columns on the logic optimizing stage and save them via fields. 3. Passing the extractor to the `ClusterReaderExecExec` executor 4. Executor sends requests to the target components instead of all of the components
type MetricSummaryTableExtractor ¶
type MetricSummaryTableExtractor struct { // SkipRequest means the where clause always false, we don't need to request any component SkipRequest bool MetricsNames set.StringSet Quantiles []float64 // contains filtered or unexported fields }
MetricSummaryTableExtractor is used to extract some predicates of metrics_schema tables.
func (*MetricSummaryTableExtractor) Extract ¶
func (e *MetricSummaryTableExtractor) Extract( _ sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) (remained []expression.Expression)
Extract implements the MemTablePredicateExtractor Extract interface
type MetricTableExtractor ¶
type MetricTableExtractor struct { // SkipRequest means the where clause always false, we don't need to request any component SkipRequest bool // StartTime represents the beginning time of metric data. StartTime time.Time // EndTime represents the ending time of metric data. EndTime time.Time // LabelConditions represents the label conditions of metric data. LabelConditions map[string]set.StringSet Quantiles []float64 // contains filtered or unexported fields }
MetricTableExtractor is used to extract some predicates of metrics_schema tables.
func (*MetricTableExtractor) Extract ¶
func (e *MetricTableExtractor) Extract( ctx sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) []expression.Expression
Extract implements the MemTablePredicateExtractor Extract interface
func (*MetricTableExtractor) GetMetricTablePromQL ¶
func (e *MetricTableExtractor) GetMetricTablePromQL(sctx sessionctx.Context, lowerTableName string) string
GetMetricTablePromQL uses to get the promQL of metric table.
type NominalSort ¶
type NominalSort struct { // These two fields are used to switch ScalarFunctions to Constants. For these // NominalSorts, we need to converted to Projections check if the ScalarFunctions // are out of bounds. (issue #11653) ByItems []*ByItems OnlyColumn bool // contains filtered or unexported fields }
NominalSort asks sort properties for its child. It is a fake operator that will not appear in final physical operator tree. It will be eliminated or converted to Projection.
func (*NominalSort) Children ¶
func (p *NominalSort) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*NominalSort) ExplainInfo ¶
func (p *NominalSort) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*NominalSort) ExplainNormalizedInfo ¶
func (p *NominalSort) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*NominalSort) GetChildReqProps ¶
func (p *NominalSort) GetChildReqProps(idx int) *property.PhysicalProperty
func (NominalSort) Init ¶
func (p NominalSort) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *NominalSort
Init initializes NominalSort.
func (*NominalSort) ResolveIndices ¶
func (p *NominalSort) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*NominalSort) Schema ¶
func (p *NominalSort) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*NominalSort) SetChild ¶
func (p *NominalSort) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*NominalSort) SetChildren ¶
func (p *NominalSort) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*NominalSort) StatsCount ¶
func (p *NominalSort) StatsCount() float64
func (*NominalSort) ToPB ¶
func (p *NominalSort) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PBPlanBuilder ¶
type PBPlanBuilder struct {
// contains filtered or unexported fields
}
PBPlanBuilder uses to build physical plan from dag protocol buffers.
func NewPBPlanBuilder ¶
func NewPBPlanBuilder(sctx sessionctx.Context, is infoschema.InfoSchema) *PBPlanBuilder
NewPBPlanBuilder creates a new pb plan builder.
func (*PBPlanBuilder) Build ¶
func (b *PBPlanBuilder) Build(executors []*tipb.Executor) (p PhysicalPlan, err error)
Build builds physical plan from dag protocol buffers.
type PSTMTPlanCacheValue ¶
type PSTMTPlanCacheValue struct { Plan Plan OutPutNames []*types.FieldName TblInfo2UnionScan map[*model.TableInfo]bool }
PSTMTPlanCacheValue stores the cached Statement and StmtNode.
func NewPSTMTPlanCacheValue ¶
func NewPSTMTPlanCacheValue(plan Plan, names []*types.FieldName, srcMap map[*model.TableInfo]bool) *PSTMTPlanCacheValue
NewPSTMTPlanCacheValue creates a SQLCacheValue.
type PartitionSplitterType ¶
type PartitionSplitterType int
PartitionSplitterType is the type of `Shuffle` executor splitter, which splits data source into partitions.
type PhysicalApply ¶
type PhysicalApply struct { PhysicalHashJoin OuterSchema []*expression.CorrelatedColumn }
PhysicalApply represents apply plan, only used for subquery.
func (*PhysicalApply) GetCost ¶
func (p *PhysicalApply) GetCost(lCount, rCount, lCost, rCost float64) float64
GetCost computes the cost of apply operator.
func (PhysicalApply) Init ¶
func (p PhysicalApply) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalApply
Init initializes PhysicalApply.
func (*PhysicalApply) ResolveIndices ¶
func (p *PhysicalApply) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
type PhysicalHashAgg ¶
type PhysicalHashAgg struct {
// contains filtered or unexported fields
}
PhysicalHashAgg is hash operator of aggregate.
func NewPhysicalHashAgg ¶
func NewPhysicalHashAgg(la *LogicalAggregation, newStats *property.StatsInfo, prop *property.PhysicalProperty) *PhysicalHashAgg
NewPhysicalHashAgg creates a new PhysicalHashAgg from a LogicalAggregation.
func (*PhysicalHashAgg) ExplainInfo ¶
func (p *PhysicalHashAgg) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalHashAgg) ExplainNormalizedInfo ¶
func (p *PhysicalHashAgg) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalHashAgg) GetCost ¶
func (p *PhysicalHashAgg) GetCost(inputRows float64, isRoot bool) float64
GetCost computes the cost of hash aggregation considering CPU/memory.
func (PhysicalHashAgg) Init ¶
func (base PhysicalHashAgg) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *basePhysicalAgg
Init initializes basePhysicalAgg.
func (*PhysicalHashAgg) ResolveIndices ¶
func (p *PhysicalHashAgg) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalHashAgg) ToPB ¶
func (p *PhysicalHashAgg) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalHashJoin ¶
type PhysicalHashJoin struct { Concurrency uint EqualConditions []*expression.ScalarFunction // use the outer table to build a hash table when the outer table is smaller. UseOuterToBuild bool // contains filtered or unexported fields }
PhysicalHashJoin represents hash join implementation of LogicalJoin.
func NewPhysicalHashJoin ¶
func NewPhysicalHashJoin(p *LogicalJoin, innerIdx int, useOuterToBuild bool, newStats *property.StatsInfo, prop ...*property.PhysicalProperty) *PhysicalHashJoin
NewPhysicalHashJoin creates a new PhysicalHashJoin from LogicalJoin.
func (*PhysicalHashJoin) ExplainInfo ¶
func (p *PhysicalHashJoin) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalHashJoin) ExplainNormalizedInfo ¶
func (p *PhysicalHashJoin) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalHashJoin) GetCost ¶
func (p *PhysicalHashJoin) GetCost(lCnt, rCnt float64) float64
GetCost computes cost of hash join operator itself.
func (PhysicalHashJoin) Init ¶
func (p PhysicalHashJoin) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalHashJoin
Init initializes PhysicalHashJoin.
func (*PhysicalHashJoin) ResolveIndices ¶
func (p *PhysicalHashJoin) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
type PhysicalIndexHashJoin ¶
type PhysicalIndexHashJoin struct { PhysicalIndexJoin // KeepOuterOrder indicates whether keeping the output result order as the // outer side. KeepOuterOrder bool }
PhysicalIndexHashJoin represents the plan of index look up hash join.
func (*PhysicalIndexHashJoin) GetCost ¶
func (p *PhysicalIndexHashJoin) GetCost(outerTask, innerTask task) float64
GetCost computes the cost of index merge join operator and its children.
func (PhysicalIndexHashJoin) Init ¶
func (p PhysicalIndexHashJoin) Init(ctx sessionctx.Context) *PhysicalIndexHashJoin
Init initializes PhysicalIndexHashJoin.
type PhysicalIndexJoin ¶
type PhysicalIndexJoin struct { // Ranges stores the IndexRanges when the inner plan is index scan. Ranges []*ranger.Range // KeyOff2IdxOff maps the offsets in join key to the offsets in the index. KeyOff2IdxOff []int // IdxColLens stores the length of each index column. IdxColLens []int // CompareFilters stores the filters for last column if those filters need to be evaluated during execution. // e.g. select * from t, t1 where t.a = t1.a and t.b > t1.b and t.b < t1.b+10 // If there's index(t.a, t.b). All the filters can be used to construct index range but t.b > t1.b and t.b < t1.b=10 // need to be evaluated after we fetch the data of t1. // This struct stores them and evaluate them to ranges. CompareFilters *ColWithCmpFuncManager // contains filtered or unexported fields }
PhysicalIndexJoin represents the plan of index look up join.
func (*PhysicalIndexJoin) ExplainInfo ¶
func (p *PhysicalIndexJoin) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalIndexJoin) ExplainNormalizedInfo ¶
func (p *PhysicalIndexJoin) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalIndexJoin) GetCost ¶
func (p *PhysicalIndexJoin) GetCost(outerTask, innerTask task) float64
GetCost computes the cost of index join operator and its children.
func (PhysicalIndexJoin) Init ¶
func (p PhysicalIndexJoin) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalIndexJoin
Init initializes PhysicalIndexJoin.
func (*PhysicalIndexJoin) ResolveIndices ¶
func (p *PhysicalIndexJoin) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
type PhysicalIndexLookUpReader ¶
type PhysicalIndexLookUpReader struct { // IndexPlans flats the indexPlan to construct executor pb. IndexPlans []PhysicalPlan // TablePlans flats the tablePlan to construct executor pb. TablePlans []PhysicalPlan ExtraHandleCol *expression.Column // PushedLimit is used to avoid unnecessary table scan tasks of IndexLookUpReader. PushedLimit *PushedDownLimit // contains filtered or unexported fields }
PhysicalIndexLookUpReader is the index look up reader in tidb. It's used in case of double reading.
func (*PhysicalIndexLookUpReader) ExplainInfo ¶
func (p *PhysicalIndexLookUpReader) ExplainInfo() string
ExplainInfo implements Plan interface.
func (PhysicalIndexLookUpReader) Init ¶
func (p PhysicalIndexLookUpReader) Init(ctx sessionctx.Context, offset int) *PhysicalIndexLookUpReader
Init initializes PhysicalIndexLookUpReader.
func (*PhysicalIndexLookUpReader) ResolveIndices ¶
func (p *PhysicalIndexLookUpReader) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalIndexLookUpReader) Schema ¶
func (s *PhysicalIndexLookUpReader) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalIndexLookUpReader) SetSchema ¶
func (s *PhysicalIndexLookUpReader) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalIndexMergeJoin ¶
type PhysicalIndexMergeJoin struct { PhysicalIndexJoin // KeyOff2KeyOffOrderByIdx maps the offsets in join keys to the offsets in join keys order by index. KeyOff2KeyOffOrderByIdx []int // CompareFuncs store the compare functions for outer join keys and inner join key. CompareFuncs []expression.CompareFunc // OuterCompareFuncs store the compare functions for outer join keys and outer join // keys, it's for outer rows sort's convenience. OuterCompareFuncs []expression.CompareFunc // NeedOuterSort means whether outer rows should be sorted to build range. NeedOuterSort bool // Desc means whether inner child keep desc order. Desc bool }
PhysicalIndexMergeJoin represents the plan of index look up merge join.
func (*PhysicalIndexMergeJoin) GetCost ¶
func (p *PhysicalIndexMergeJoin) GetCost(outerTask, innerTask task) float64
GetCost computes the cost of index merge join operator and its children.
func (PhysicalIndexMergeJoin) Init ¶
func (p PhysicalIndexMergeJoin) Init(ctx sessionctx.Context) *PhysicalIndexMergeJoin
Init initializes PhysicalIndexMergeJoin.
type PhysicalIndexMergeReader ¶
type PhysicalIndexMergeReader struct { // PartialPlans flats the partialPlans to construct executor pb. PartialPlans [][]PhysicalPlan // TablePlans flats the tablePlan to construct executor pb. TablePlans []PhysicalPlan // contains filtered or unexported fields }
PhysicalIndexMergeReader is the reader using multiple indexes in tidb.
func (*PhysicalIndexMergeReader) ExplainInfo ¶
func (p *PhysicalIndexMergeReader) ExplainInfo() string
ExplainInfo implements Plan interface.
func (PhysicalIndexMergeReader) Init ¶
func (p PhysicalIndexMergeReader) Init(ctx sessionctx.Context, offset int) *PhysicalIndexMergeReader
Init initializes PhysicalIndexMergeReader.
func (*PhysicalIndexMergeReader) ResolveIndices ¶
func (p *PhysicalIndexMergeReader) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalIndexMergeReader) Schema ¶
func (s *PhysicalIndexMergeReader) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalIndexMergeReader) SetSchema ¶
func (s *PhysicalIndexMergeReader) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalIndexReader ¶
type PhysicalIndexReader struct { // IndexPlans flats the indexPlan to construct executor pb. IndexPlans []PhysicalPlan // OutputColumns represents the columns that index reader should return. OutputColumns []*expression.Column // contains filtered or unexported fields }
PhysicalIndexReader is the index reader in tidb.
func (*PhysicalIndexReader) ExplainInfo ¶
func (p *PhysicalIndexReader) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalIndexReader) ExplainNormalizedInfo ¶
func (p *PhysicalIndexReader) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (PhysicalIndexReader) Init ¶
func (p PhysicalIndexReader) Init(ctx sessionctx.Context, offset int) *PhysicalIndexReader
Init initializes PhysicalIndexReader.
func (*PhysicalIndexReader) ResolveIndices ¶
func (p *PhysicalIndexReader) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalIndexReader) Schema ¶
func (s *PhysicalIndexReader) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalIndexReader) SetChildren ¶
func (p *PhysicalIndexReader) SetChildren(children ...PhysicalPlan)
SetChildren overrides PhysicalPlan SetChildren interface.
func (*PhysicalIndexReader) SetSchema ¶
func (p *PhysicalIndexReader) SetSchema(_ *expression.Schema)
SetSchema overrides PhysicalPlan SetSchema interface.
type PhysicalIndexScan ¶
type PhysicalIndexScan struct { // AccessCondition is used to calculate range. AccessCondition []expression.Expression Table *model.TableInfo Index *model.IndexInfo IdxCols []*expression.Column IdxColLens []int Ranges []*ranger.Range Columns []*model.ColumnInfo DBName model.CIStr TableAsName *model.CIStr // Hist is the histogram when the query was issued. // It is used for query feedback. Hist *statistics.Histogram GenExprs map[model.TableColumnID]expression.Expression Desc bool KeepOrder bool // DoubleRead means if the index executor will read kv two times. // If the query requires the columns that don't belong to index, DoubleRead will be true. DoubleRead bool // contains filtered or unexported fields }
PhysicalIndexScan represents an index scan plan.
func (*PhysicalIndexScan) AccessObject ¶
func (p *PhysicalIndexScan) AccessObject() string
AccessObject implements dataAccesser interface.
func (*PhysicalIndexScan) ExplainID ¶
func (p *PhysicalIndexScan) ExplainID() fmt.Stringer
ExplainID overrides the ExplainID in order to match different range.
func (*PhysicalIndexScan) ExplainInfo ¶
func (p *PhysicalIndexScan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalIndexScan) ExplainNormalizedInfo ¶
func (p *PhysicalIndexScan) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (PhysicalIndexScan) Init ¶
func (p PhysicalIndexScan) Init(ctx sessionctx.Context, offset int) *PhysicalIndexScan
Init initializes PhysicalIndexScan.
func (*PhysicalIndexScan) IsPartition ¶
func (p *PhysicalIndexScan) IsPartition() (bool, int64)
IsPartition returns true and partition ID if it works on a partition.
func (*PhysicalIndexScan) IsPointGetByUniqueKey ¶
func (p *PhysicalIndexScan) IsPointGetByUniqueKey(sc *stmtctx.StatementContext) bool
IsPointGetByUniqueKey checks whether is a point get by unique key.
func (*PhysicalIndexScan) OperatorInfo ¶
func (p *PhysicalIndexScan) OperatorInfo(normalized bool) string
OperatorInfo implements dataAccesser interface.
func (*PhysicalIndexScan) ResolveIndices ¶
func (p *PhysicalIndexScan) ResolveIndices() (err error)
func (*PhysicalIndexScan) Schema ¶
func (s *PhysicalIndexScan) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalIndexScan) SetSchema ¶
func (s *PhysicalIndexScan) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
func (*PhysicalIndexScan) ToPB ¶
func (p *PhysicalIndexScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalLimit ¶
PhysicalLimit is the physical operator of Limit.
func (*PhysicalLimit) Children ¶
func (p *PhysicalLimit) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalLimit) ExplainInfo ¶
func (p *PhysicalLimit) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalLimit) ExplainNormalizedInfo ¶
func (p *PhysicalLimit) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalLimit) GetChildReqProps ¶
func (p *PhysicalLimit) GetChildReqProps(idx int) *property.PhysicalProperty
func (PhysicalLimit) Init ¶
func (p PhysicalLimit) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalLimit
Init initializes PhysicalLimit.
func (*PhysicalLimit) ResolveIndices ¶
func (p *PhysicalLimit) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalLimit) Schema ¶
func (p *PhysicalLimit) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalLimit) SetChild ¶
func (p *PhysicalLimit) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalLimit) SetChildren ¶
func (p *PhysicalLimit) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalLimit) StatsCount ¶
func (p *PhysicalLimit) StatsCount() float64
func (*PhysicalLimit) ToPB ¶
func (p *PhysicalLimit) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalLock ¶
type PhysicalLock struct { Lock ast.SelectLockType TblID2Handle map[int64][]*expression.Column PartitionedTable []table.PartitionedTable // contains filtered or unexported fields }
PhysicalLock is the physical operator of lock, which is used for `select ... for update` clause.
func (*PhysicalLock) Children ¶
func (p *PhysicalLock) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalLock) ExplainInfo ¶
func (p *PhysicalLock) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalLock) ExplainNormalizedInfo ¶
func (p *PhysicalLock) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalLock) GetChildReqProps ¶
func (p *PhysicalLock) GetChildReqProps(idx int) *property.PhysicalProperty
func (PhysicalLock) Init ¶
func (p PhysicalLock) Init(ctx sessionctx.Context, stats *property.StatsInfo, props ...*property.PhysicalProperty) *PhysicalLock
Init initializes PhysicalLock.
func (*PhysicalLock) ResolveIndices ¶
func (p *PhysicalLock) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalLock) Schema ¶
func (p *PhysicalLock) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalLock) SetChild ¶
func (p *PhysicalLock) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalLock) SetChildren ¶
func (p *PhysicalLock) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalLock) StatsCount ¶
func (p *PhysicalLock) StatsCount() float64
func (*PhysicalLock) ToPB ¶
func (p *PhysicalLock) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalMaxOneRow ¶
type PhysicalMaxOneRow struct {
// contains filtered or unexported fields
}
PhysicalMaxOneRow is the physical operator of maxOneRow.
func (*PhysicalMaxOneRow) Children ¶
func (p *PhysicalMaxOneRow) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalMaxOneRow) ExplainInfo ¶
func (p *PhysicalMaxOneRow) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalMaxOneRow) ExplainNormalizedInfo ¶
func (p *PhysicalMaxOneRow) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalMaxOneRow) GetChildReqProps ¶
func (p *PhysicalMaxOneRow) GetChildReqProps(idx int) *property.PhysicalProperty
func (PhysicalMaxOneRow) Init ¶
func (p PhysicalMaxOneRow) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalMaxOneRow
Init initializes PhysicalMaxOneRow.
func (*PhysicalMaxOneRow) ResolveIndices ¶
func (p *PhysicalMaxOneRow) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalMaxOneRow) Schema ¶
func (p *PhysicalMaxOneRow) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalMaxOneRow) SetChild ¶
func (p *PhysicalMaxOneRow) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalMaxOneRow) SetChildren ¶
func (p *PhysicalMaxOneRow) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalMaxOneRow) StatsCount ¶
func (p *PhysicalMaxOneRow) StatsCount() float64
func (*PhysicalMaxOneRow) ToPB ¶
func (p *PhysicalMaxOneRow) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalMemTable ¶
type PhysicalMemTable struct { DBName model.CIStr Table *model.TableInfo Columns []*model.ColumnInfo Extractor MemTablePredicateExtractor QueryTimeRange QueryTimeRange // contains filtered or unexported fields }
PhysicalMemTable reads memory table.
func (*PhysicalMemTable) AccessObject ¶
func (p *PhysicalMemTable) AccessObject() string
AccessObject implements dataAccesser interface.
func (*PhysicalMemTable) ExplainInfo ¶
func (p *PhysicalMemTable) ExplainInfo() string
ExplainInfo implements Plan interface.
func (PhysicalMemTable) Init ¶
func (p PhysicalMemTable) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *PhysicalMemTable
Init initializes PhysicalMemTable.
func (*PhysicalMemTable) OperatorInfo ¶
func (p *PhysicalMemTable) OperatorInfo(_ bool) string
OperatorInfo implements dataAccesser interface.
func (*PhysicalMemTable) ResolveIndices ¶
func (p *PhysicalMemTable) ResolveIndices() (err error)
func (*PhysicalMemTable) Schema ¶
func (s *PhysicalMemTable) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalMemTable) SetSchema ¶
func (s *PhysicalMemTable) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalMergeJoin ¶
type PhysicalMergeJoin struct { CompareFuncs []expression.CompareFunc // Desc means whether inner child keep desc order. Desc bool // contains filtered or unexported fields }
PhysicalMergeJoin represents merge join implementation of LogicalJoin.
func BuildMergeJoinPlan ¶
func BuildMergeJoinPlan(ctx sessionctx.Context, joinType JoinType, leftKeys, rightKeys []*expression.Column) *PhysicalMergeJoin
BuildMergeJoinPlan builds a PhysicalMergeJoin from the given fields. Currently, it is only used for test purpose.
func (*PhysicalMergeJoin) ExplainInfo ¶
func (p *PhysicalMergeJoin) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalMergeJoin) ExplainNormalizedInfo ¶
func (p *PhysicalMergeJoin) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalMergeJoin) GetCost ¶
func (p *PhysicalMergeJoin) GetCost(lCnt, rCnt float64) float64
GetCost computes cost of merge join operator itself.
func (PhysicalMergeJoin) Init ¶
func (p PhysicalMergeJoin) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *PhysicalMergeJoin
Init initializes PhysicalMergeJoin.
func (*PhysicalMergeJoin) ResolveIndices ¶
func (p *PhysicalMergeJoin) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
type PhysicalPlan ¶
type PhysicalPlan interface { Plan // ToPB converts physical plan to tipb executor. ToPB(ctx sessionctx.Context) (*tipb.Executor, error) // getChildReqProps gets the required property by child index. GetChildReqProps(idx int) *property.PhysicalProperty // StatsCount returns the count of property.StatsInfo for this plan. StatsCount() float64 // Get all the children. Children() []PhysicalPlan // SetChildren sets the children for the plan. SetChildren(...PhysicalPlan) // SetChild sets the ith child for the plan. SetChild(i int, child PhysicalPlan) // ResolveIndices resolves the indices for columns. After doing this, the columns can evaluate the rows by their indices. ResolveIndices() error // Stats returns the StatsInfo of the plan. Stats() *property.StatsInfo // ExplainNormalizedInfo returns operator normalized information for generating digest. ExplainNormalizedInfo() string // contains filtered or unexported methods }
PhysicalPlan is a tree of the physical operators.
func DoOptimize ¶
func DoOptimize(ctx context.Context, sctx sessionctx.Context, flag uint64, logic LogicalPlan) (PhysicalPlan, float64, error)
DoOptimize optimizes a logical plan to a physical plan.
func InjectProjBelowAgg ¶
func InjectProjBelowAgg(aggPlan PhysicalPlan, aggFuncs []*aggregation.AggFuncDesc, groupByItems []expression.Expression) PhysicalPlan
InjectProjBelowAgg injects a ProjOperator below AggOperator. If all the args of `aggFuncs`, and all the item of `groupByItems` are columns or constants, we do not need to build the `proj`.
func InjectProjBelowSort ¶
func InjectProjBelowSort(p PhysicalPlan, orderByItems []*ByItems) PhysicalPlan
InjectProjBelowSort extracts the ScalarFunctions of `orderByItems` into a PhysicalProjection and injects it below PhysicalTopN/PhysicalSort. The schema of PhysicalSort and PhysicalTopN are the same as the schema of their children. When a projection is injected as the child of PhysicalSort and PhysicalTopN, some extra columns will be added into the schema of the Projection, thus we need to add another Projection upon them to prune the redundant columns.
func TurnNominalSortIntoProj ¶
func TurnNominalSortIntoProj(p PhysicalPlan, onlyColumn bool, orderByItems []*ByItems) PhysicalPlan
TurnNominalSortIntoProj will turn nominal sort into two projections. This is to check if the scalar functions will overflow.
type PhysicalProjection ¶
type PhysicalProjection struct { Exprs []expression.Expression CalculateNoDelay bool AvoidColumnEvaluator bool // contains filtered or unexported fields }
PhysicalProjection is the physical operator of projection.
func (*PhysicalProjection) ExplainInfo ¶
func (p *PhysicalProjection) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalProjection) ExplainNormalizedInfo ¶
func (p *PhysicalProjection) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalProjection) GetCost ¶
func (p *PhysicalProjection) GetCost(count float64) float64
GetCost computes the cost of projection operator itself.
func (PhysicalProjection) Init ¶
func (p PhysicalProjection) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalProjection
Init initializes PhysicalProjection.
func (*PhysicalProjection) ResolveIndices ¶
func (p *PhysicalProjection) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalProjection) Schema ¶
func (s *PhysicalProjection) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalProjection) SetSchema ¶
func (s *PhysicalProjection) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalSelection ¶
type PhysicalSelection struct { Conditions []expression.Expression // contains filtered or unexported fields }
PhysicalSelection represents a filter.
func (*PhysicalSelection) Children ¶
func (p *PhysicalSelection) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalSelection) ExplainInfo ¶
func (p *PhysicalSelection) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalSelection) ExplainNormalizedInfo ¶
func (p *PhysicalSelection) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalSelection) GetChildReqProps ¶
func (p *PhysicalSelection) GetChildReqProps(idx int) *property.PhysicalProperty
func (PhysicalSelection) Init ¶
func (p PhysicalSelection) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalSelection
Init initializes PhysicalSelection.
func (*PhysicalSelection) ResolveIndices ¶
func (p *PhysicalSelection) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalSelection) Schema ¶
func (p *PhysicalSelection) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalSelection) SetChild ¶
func (p *PhysicalSelection) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalSelection) SetChildren ¶
func (p *PhysicalSelection) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalSelection) StatsCount ¶
func (p *PhysicalSelection) StatsCount() float64
func (*PhysicalSelection) ToPB ¶
func (p *PhysicalSelection) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalShow ¶
type PhysicalShow struct { ShowContents // contains filtered or unexported fields }
PhysicalShow represents a show plan.
func (PhysicalShow) Init ¶
func (p PhysicalShow) Init(ctx sessionctx.Context) *PhysicalShow
Init initializes PhysicalShow.
func (*PhysicalShow) ResolveIndices ¶
func (p *PhysicalShow) ResolveIndices() (err error)
func (*PhysicalShow) Schema ¶
func (s *PhysicalShow) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalShow) SetSchema ¶
func (s *PhysicalShow) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalShowDDLJobs ¶
type PhysicalShowDDLJobs struct { JobNumber int64 // contains filtered or unexported fields }
PhysicalShowDDLJobs is for showing DDL job list.
func (PhysicalShowDDLJobs) Init ¶
func (p PhysicalShowDDLJobs) Init(ctx sessionctx.Context) *PhysicalShowDDLJobs
Init initializes PhysicalShowDDLJobs.
func (*PhysicalShowDDLJobs) ResolveIndices ¶
func (p *PhysicalShowDDLJobs) ResolveIndices() (err error)
func (*PhysicalShowDDLJobs) Schema ¶
func (s *PhysicalShowDDLJobs) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalShowDDLJobs) SetSchema ¶
func (s *PhysicalShowDDLJobs) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalShuffle ¶
type PhysicalShuffle struct { Concurrency int Tail PhysicalPlan DataSource PhysicalPlan SplitterType PartitionSplitterType HashByItems []expression.Expression // contains filtered or unexported fields }
PhysicalShuffle represents a shuffle plan. `Tail` and `DataSource` are the last plan within and the first plan following the "shuffle", respectively,
to build the child executors chain.
Take `Window` operator for example:
Shuffle -> Window -> Sort -> DataSource, will be separated into: ==> Shuffle: for main thread ==> Window -> Sort(:Tail) -> shuffleWorker: for workers ==> DataSource: for `fetchDataAndSplit` thread
func (*PhysicalShuffle) Children ¶
func (p *PhysicalShuffle) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalShuffle) ExplainInfo ¶
func (p *PhysicalShuffle) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalShuffle) ExplainNormalizedInfo ¶
func (p *PhysicalShuffle) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalShuffle) GetChildReqProps ¶
func (p *PhysicalShuffle) GetChildReqProps(idx int) *property.PhysicalProperty
func (PhysicalShuffle) Init ¶
func (p PhysicalShuffle) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalShuffle
Init initializes PhysicalShuffle.
func (*PhysicalShuffle) ResolveIndices ¶
func (p *PhysicalShuffle) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalShuffle) Schema ¶
func (p *PhysicalShuffle) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalShuffle) SetChild ¶
func (p *PhysicalShuffle) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalShuffle) SetChildren ¶
func (p *PhysicalShuffle) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalShuffle) StatsCount ¶
func (p *PhysicalShuffle) StatsCount() float64
func (*PhysicalShuffle) ToPB ¶
func (p *PhysicalShuffle) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalShuffleDataSourceStub ¶
type PhysicalShuffleDataSourceStub struct { // Worker points to `executor.shuffleWorker`. Worker unsafe.Pointer // contains filtered or unexported fields }
PhysicalShuffleDataSourceStub represents a data source stub of `PhysicalShuffle`, and actually, is executed by `executor.shuffleWorker`.
func (PhysicalShuffleDataSourceStub) Init ¶
func (p PhysicalShuffleDataSourceStub) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalShuffleDataSourceStub
Init initializes PhysicalShuffleDataSourceStub.
func (*PhysicalShuffleDataSourceStub) ResolveIndices ¶
func (p *PhysicalShuffleDataSourceStub) ResolveIndices() (err error)
func (*PhysicalShuffleDataSourceStub) Schema ¶
func (s *PhysicalShuffleDataSourceStub) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalShuffleDataSourceStub) SetSchema ¶
func (s *PhysicalShuffleDataSourceStub) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalSort ¶
type PhysicalSort struct { ByItems []*ByItems // contains filtered or unexported fields }
PhysicalSort is the physical operator of sort, which implements a memory sort.
func (*PhysicalSort) Children ¶
func (p *PhysicalSort) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalSort) ExplainInfo ¶
func (p *PhysicalSort) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalSort) ExplainNormalizedInfo ¶
func (p *PhysicalSort) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalSort) GetChildReqProps ¶
func (p *PhysicalSort) GetChildReqProps(idx int) *property.PhysicalProperty
func (*PhysicalSort) GetCost ¶
func (p *PhysicalSort) GetCost(count float64, schema *expression.Schema) float64
GetCost computes the cost of in memory sort.
func (PhysicalSort) Init ¶
func (p PhysicalSort) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalSort
Init initializes PhysicalSort.
func (*PhysicalSort) ResolveIndices ¶
func (p *PhysicalSort) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalSort) Schema ¶
func (p *PhysicalSort) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalSort) SetChild ¶
func (p *PhysicalSort) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalSort) SetChildren ¶
func (p *PhysicalSort) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalSort) StatsCount ¶
func (p *PhysicalSort) StatsCount() float64
func (*PhysicalSort) ToPB ¶
func (p *PhysicalSort) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalStreamAgg ¶
type PhysicalStreamAgg struct {
// contains filtered or unexported fields
}
PhysicalStreamAgg is stream operator of aggregate.
func (*PhysicalStreamAgg) ExplainInfo ¶
func (p *PhysicalStreamAgg) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalStreamAgg) ExplainNormalizedInfo ¶
func (p *PhysicalStreamAgg) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalStreamAgg) GetCost ¶
func (p *PhysicalStreamAgg) GetCost(inputRows float64, isRoot bool) float64
GetCost computes cost of stream aggregation considering CPU/memory.
func (PhysicalStreamAgg) Init ¶
func (base PhysicalStreamAgg) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *basePhysicalAgg
Init initializes basePhysicalAgg.
func (*PhysicalStreamAgg) ResolveIndices ¶
func (p *PhysicalStreamAgg) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalStreamAgg) ToPB ¶
func (p *PhysicalStreamAgg) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalTableDual ¶
type PhysicalTableDual struct { RowCount int // contains filtered or unexported fields }
PhysicalTableDual is the physical operator of dual.
func (*PhysicalTableDual) ExplainInfo ¶
func (p *PhysicalTableDual) ExplainInfo() string
ExplainInfo implements Plan interface.
func (PhysicalTableDual) Init ¶
func (p PhysicalTableDual) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int) *PhysicalTableDual
Init initializes PhysicalTableDual.
func (*PhysicalTableDual) OutputNames ¶
func (p *PhysicalTableDual) OutputNames() types.NameSlice
OutputNames returns the outputting names of each column.
func (*PhysicalTableDual) ResolveIndices ¶
func (p *PhysicalTableDual) ResolveIndices() (err error)
func (*PhysicalTableDual) Schema ¶
func (s *PhysicalTableDual) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalTableDual) SetOutputNames ¶
func (p *PhysicalTableDual) SetOutputNames(names types.NameSlice)
SetOutputNames sets the outputting name by the given slice.
func (*PhysicalTableDual) SetSchema ¶
func (s *PhysicalTableDual) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalTableReader ¶
type PhysicalTableReader struct { // TablePlans flats the tablePlan to construct executor pb. TablePlans []PhysicalPlan // StoreType indicates table read from which type of store. StoreType kv.StoreType // contains filtered or unexported fields }
PhysicalTableReader is the table reader in tidb.
func (*PhysicalTableReader) ExplainInfo ¶
func (p *PhysicalTableReader) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalTableReader) ExplainNormalizedInfo ¶
func (p *PhysicalTableReader) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (PhysicalTableReader) Init ¶
func (p PhysicalTableReader) Init(ctx sessionctx.Context, offset int) *PhysicalTableReader
Init initializes PhysicalTableReader.
func (*PhysicalTableReader) ResolveIndices ¶
func (p *PhysicalTableReader) ResolveIndices() error
ResolveIndices implements Plan interface.
func (*PhysicalTableReader) Schema ¶
func (s *PhysicalTableReader) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalTableReader) SetChildren ¶
func (p *PhysicalTableReader) SetChildren(children ...PhysicalPlan)
SetChildren overrides PhysicalPlan SetChildren interface.
func (*PhysicalTableReader) SetSchema ¶
func (s *PhysicalTableReader) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalTableScan ¶
type PhysicalTableScan struct { // AccessCondition is used to calculate range. AccessCondition []expression.Expression Table *model.TableInfo Columns []*model.ColumnInfo DBName model.CIStr Ranges []*ranger.Range TableAsName *model.CIStr // Hist is the histogram when the query was issued. // It is used for query feedback. Hist *statistics.Histogram // HandleIdx is the index of handle, which is only used for admin check table. HandleIdx int StoreType kv.StoreType // KeepOrder is true, if sort data by scanning pkcol, KeepOrder bool Desc bool // contains filtered or unexported fields }
PhysicalTableScan represents a table scan plan.
func (*PhysicalTableScan) AccessObject ¶
func (p *PhysicalTableScan) AccessObject() string
AccessObject implements dataAccesser interface.
func (*PhysicalTableScan) ExplainID ¶
func (p *PhysicalTableScan) ExplainID() fmt.Stringer
ExplainID overrides the ExplainID in order to match different range.
func (*PhysicalTableScan) ExplainInfo ¶
func (p *PhysicalTableScan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalTableScan) ExplainNormalizedInfo ¶
func (p *PhysicalTableScan) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (PhysicalTableScan) Init ¶
func (p PhysicalTableScan) Init(ctx sessionctx.Context, offset int) *PhysicalTableScan
Init initializes PhysicalTableScan.
func (*PhysicalTableScan) IsPartition ¶
func (ts *PhysicalTableScan) IsPartition() (bool, int64)
IsPartition returns true and partition ID if it's actually a partition.
func (*PhysicalTableScan) OperatorInfo ¶
func (p *PhysicalTableScan) OperatorInfo(normalized bool) string
OperatorInfo implements dataAccesser interface.
func (*PhysicalTableScan) ResolveIndices ¶
func (p *PhysicalTableScan) ResolveIndices() (err error)
func (*PhysicalTableScan) Schema ¶
func (s *PhysicalTableScan) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalTableScan) SetIsChildOfIndexLookUp ¶
func (ts *PhysicalTableScan) SetIsChildOfIndexLookUp(isIsChildOfIndexLookUp bool)
SetIsChildOfIndexLookUp is to set the bool if is a child of IndexLookUpReader
func (*PhysicalTableScan) SetSchema ¶
func (s *PhysicalTableScan) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
func (*PhysicalTableScan) ToPB ¶
func (p *PhysicalTableScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalTopN ¶
type PhysicalTopN struct { ByItems []*ByItems Offset uint64 Count uint64 // contains filtered or unexported fields }
PhysicalTopN is the physical operator of topN.
func (*PhysicalTopN) Children ¶
func (p *PhysicalTopN) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalTopN) ExplainInfo ¶
func (p *PhysicalTopN) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalTopN) ExplainNormalizedInfo ¶
func (p *PhysicalTopN) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PhysicalTopN) GetChildReqProps ¶
func (p *PhysicalTopN) GetChildReqProps(idx int) *property.PhysicalProperty
func (*PhysicalTopN) GetCost ¶
func (p *PhysicalTopN) GetCost(count float64, isRoot bool) float64
GetCost computes cost of TopN operator itself.
func (PhysicalTopN) Init ¶
func (p PhysicalTopN) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalTopN
Init initializes PhysicalTopN.
func (*PhysicalTopN) ResolveIndices ¶
func (p *PhysicalTopN) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalTopN) Schema ¶
func (p *PhysicalTopN) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalTopN) SetChild ¶
func (p *PhysicalTopN) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalTopN) SetChildren ¶
func (p *PhysicalTopN) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalTopN) StatsCount ¶
func (p *PhysicalTopN) StatsCount() float64
func (*PhysicalTopN) ToPB ¶
func (p *PhysicalTopN) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalUnionAll ¶
type PhysicalUnionAll struct {
// contains filtered or unexported fields
}
PhysicalUnionAll is the physical operator of UnionAll.
func (PhysicalUnionAll) Init ¶
func (p PhysicalUnionAll) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalUnionAll
Init initializes PhysicalUnionAll.
func (*PhysicalUnionAll) ResolveIndices ¶
func (p *PhysicalUnionAll) ResolveIndices() (err error)
func (*PhysicalUnionAll) Schema ¶
func (s *PhysicalUnionAll) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalUnionAll) SetSchema ¶
func (s *PhysicalUnionAll) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PhysicalUnionScan ¶
type PhysicalUnionScan struct { Conditions []expression.Expression HandleCol *expression.Column // contains filtered or unexported fields }
PhysicalUnionScan represents a union scan operator.
func (*PhysicalUnionScan) Children ¶
func (p *PhysicalUnionScan) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalUnionScan) ExplainInfo ¶
func (p *PhysicalUnionScan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalUnionScan) ExplainNormalizedInfo ¶
func (p *PhysicalUnionScan) ExplainNormalizedInfo() string
ExplainInfo implements Plan interface.
func (*PhysicalUnionScan) GetChildReqProps ¶
func (p *PhysicalUnionScan) GetChildReqProps(idx int) *property.PhysicalProperty
func (PhysicalUnionScan) Init ¶
func (p PhysicalUnionScan) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalUnionScan
Init initializes PhysicalUnionScan.
func (*PhysicalUnionScan) ResolveIndices ¶
func (p *PhysicalUnionScan) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalUnionScan) Schema ¶
func (p *PhysicalUnionScan) Schema() *expression.Schema
Schema implements Plan Schema interface.
func (*PhysicalUnionScan) SetChild ¶
func (p *PhysicalUnionScan) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalUnionScan) SetChildren ¶
func (p *PhysicalUnionScan) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
func (*PhysicalUnionScan) StatsCount ¶
func (p *PhysicalUnionScan) StatsCount() float64
func (*PhysicalUnionScan) ToPB ¶
func (p *PhysicalUnionScan) ToPB(_ sessionctx.Context) (*tipb.Executor, error)
ToPB implements PhysicalPlan ToPB interface.
type PhysicalWindow ¶
type PhysicalWindow struct { WindowFuncDescs []*aggregation.WindowFuncDesc PartitionBy []property.Item OrderBy []property.Item Frame *WindowFrame // contains filtered or unexported fields }
PhysicalWindow is the physical operator of window function.
func (*PhysicalWindow) ExplainInfo ¶
func (p *PhysicalWindow) ExplainInfo() string
ExplainInfo implements Plan interface.
func (PhysicalWindow) Init ¶
func (p PhysicalWindow) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalWindow
Init initializes PhysicalWindow.
func (*PhysicalWindow) ResolveIndices ¶
func (p *PhysicalWindow) ResolveIndices() (err error)
ResolveIndices implements Plan interface.
func (*PhysicalWindow) Schema ¶
func (s *PhysicalWindow) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*PhysicalWindow) SetSchema ¶
func (s *PhysicalWindow) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Plan ¶
type Plan interface { // Get the schema. Schema() *expression.Schema // Get the ID. ID() int // TP get the plan type. TP() string // Get the ID in explain statement ExplainID() fmt.Stringer // ExplainInfo returns operator information to be explained. ExplainInfo() string SCtx() sessionctx.Context // OutputNames returns the outputting names of each column. OutputNames() types.NameSlice // SetOutputNames sets the outputting name by the given slice. SetOutputNames(names types.NameSlice) SelectBlockOffset() int // contains filtered or unexported methods }
Plan is the description of an execution flow. It is created from ast.Node first, then optimized by the optimizer, finally used by the executor to create a Cursor which executes the statement.
func BuildLogicalPlan ¶
func BuildLogicalPlan(ctx context.Context, sctx sessionctx.Context, node ast.Node, is infoschema.InfoSchema) (Plan, types.NameSlice, error)
BuildLogicalPlan used to build logical plan from ast.Node.
func TryFastPlan ¶
func TryFastPlan(ctx sessionctx.Context, node ast.Node) Plan
TryFastPlan tries to use the PointGetPlan for the query.
type PlanBuilder ¶
type PlanBuilder struct {
// contains filtered or unexported fields
}
PlanBuilder builds Plan from an ast.Node. It just builds the ast node straightforwardly.
func NewPlanBuilder ¶
func NewPlanBuilder(sctx sessionctx.Context, is infoschema.InfoSchema, processor *hint.BlockHintProcessor) *PlanBuilder
NewPlanBuilder creates a new PlanBuilder.
func (*PlanBuilder) BuildDataSourceFromView ¶
func (b *PlanBuilder) BuildDataSourceFromView(ctx context.Context, dbName model.CIStr, tableInfo *model.TableInfo) (LogicalPlan, error)
BuildDataSourceFromView is used to build LogicalPlan from view
func (*PlanBuilder) GetDBTableInfo ¶
func (b *PlanBuilder) GetDBTableInfo() []stmtctx.TableEntry
GetDBTableInfo gets the accessed dbs and tables info.
func (*PlanBuilder) GetOptFlag ¶
func (b *PlanBuilder) GetOptFlag() uint64
GetOptFlag gets the optFlag of the PlanBuilder.
func (*PlanBuilder) GetVisitInfo ¶
func (b *PlanBuilder) GetVisitInfo() []visitInfo
GetVisitInfo gets the visitInfo of the PlanBuilder.
func (*PlanBuilder) TableHints ¶
func (b *PlanBuilder) TableHints() *tableHintInfo
TableHints returns the *tableHintInfo of PlanBuilder.
type PointGetPlan ¶
type PointGetPlan struct { TblInfo *model.TableInfo IndexInfo *model.IndexInfo PartitionInfo *model.PartitionDefinition Handle int64 HandleParam *driver.ParamMarkerExpr IndexValues []types.Datum IndexValueParams []*driver.ParamMarkerExpr UnsignedHandle bool IsTableDual bool Lock bool LockWaitTime int64 Columns []*model.ColumnInfo // contains filtered or unexported fields }
PointGetPlan is a fast plan for simple point get. When we detect that the statement has a unique equal access condition, this plan is used. This plan is much faster to build and to execute because it avoid the optimization and coprocessor cost.
func (*PointGetPlan) AccessObject ¶
func (p *PointGetPlan) AccessObject() string
AccessObject implements dataAccesser interface.
func (*PointGetPlan) Children ¶
func (p *PointGetPlan) Children() []PhysicalPlan
Children gets all the children.
func (*PointGetPlan) ExplainInfo ¶
func (p *PointGetPlan) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*PointGetPlan) ExplainNormalizedInfo ¶
func (p *PointGetPlan) ExplainNormalizedInfo() string
ExplainNormalizedInfo implements Plan interface.
func (*PointGetPlan) GetChildReqProps ¶
func (p *PointGetPlan) GetChildReqProps(idx int) *property.PhysicalProperty
GetChildReqProps gets the required property by child index.
func (*PointGetPlan) GetCost ¶
func (p *PointGetPlan) GetCost(cols []*expression.Column) float64
GetCost returns cost of the PointGetPlan.
func (PointGetPlan) Init ¶
func (p PointGetPlan) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PointGetPlan
Init initializes PointGetPlan.
func (*PointGetPlan) OperatorInfo ¶
func (p *PointGetPlan) OperatorInfo(normalized bool) string
OperatorInfo implements dataAccesser interface.
func (*PointGetPlan) OutputNames ¶
func (p *PointGetPlan) OutputNames() types.NameSlice
OutputNames returns the outputting names of each column.
func (*PointGetPlan) ResolveIndices ¶
func (p *PointGetPlan) ResolveIndices() error
ResolveIndices resolves the indices for columns. After doing this, the columns can evaluate the rows by their indices.
func (*PointGetPlan) SCtx ¶
func (p *PointGetPlan) SCtx() sessionctx.Context
Context implements Plan Context interface.
func (*PointGetPlan) Schema ¶
func (p *PointGetPlan) Schema() *expression.Schema
Schema implements the Plan interface.
func (*PointGetPlan) SelectBlockOffset ¶
func (p *PointGetPlan) SelectBlockOffset() int
func (*PointGetPlan) SetChild ¶
func (p *PointGetPlan) SetChild(i int, child PhysicalPlan)
SetChild sets a specific child for the plan.
func (*PointGetPlan) SetChildren ¶
func (p *PointGetPlan) SetChildren(...PhysicalPlan)
SetChildren sets the children for the plan.
func (*PointGetPlan) SetOutputNames ¶
func (p *PointGetPlan) SetOutputNames(names types.NameSlice)
SetOutputNames sets the outputting name by the given slice.
func (*PointGetPlan) StatsCount ¶
func (p *PointGetPlan) StatsCount() float64
StatsCount will return the the RowCount of property.StatsInfo for this plan.
func (*PointGetPlan) ToPB ¶
func (p *PointGetPlan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
ToPB converts physical plan to tipb executor.
type Prepare ¶
Prepare represents prepare plan.
func (*Prepare) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Prepare) ResolveIndices ¶
func (p *Prepare) ResolveIndices() (err error)
func (*Prepare) Schema ¶
func (s *Prepare) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Prepare) SetOutputNames ¶
func (*Prepare) SetSchema ¶
func (s *Prepare) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type PreprocessOpt ¶
type PreprocessOpt func(*preprocessor)
PreprocessOpt presents optional parameters to `Preprocess` method.
type PushedDownLimit ¶
PushedDownLimit is the limit operator pushed down into PhysicalIndexLookUpReader.
type QueryTimeRange ¶
QueryTimeRange represents a time range specified by TIME_RANGE hint
func (*QueryTimeRange) Condition ¶
func (tr *QueryTimeRange) Condition() string
Condition returns a WHERE clause base on it's value
type RecoverIndex ¶
type RecoverIndex struct { Table *ast.TableName IndexName string // contains filtered or unexported fields }
RecoverIndex is used for backfilling corrupted index data.
func (*RecoverIndex) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*RecoverIndex) ResolveIndices ¶
func (p *RecoverIndex) ResolveIndices() (err error)
func (*RecoverIndex) Schema ¶
func (s *RecoverIndex) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*RecoverIndex) SetOutputNames ¶
func (*RecoverIndex) SetSchema ¶
func (s *RecoverIndex) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ReloadExprPushdownBlacklist ¶
type ReloadExprPushdownBlacklist struct {
// contains filtered or unexported fields
}
ReloadExprPushdownBlacklist reloads the data from expr_pushdown_blacklist table.
func (*ReloadExprPushdownBlacklist) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ReloadExprPushdownBlacklist) ResolveIndices ¶
func (p *ReloadExprPushdownBlacklist) ResolveIndices() (err error)
func (*ReloadExprPushdownBlacklist) Schema ¶
func (s *ReloadExprPushdownBlacklist) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ReloadExprPushdownBlacklist) SetOutputNames ¶
func (*ReloadExprPushdownBlacklist) SetSchema ¶
func (s *ReloadExprPushdownBlacklist) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ReloadOptRuleBlacklist ¶
type ReloadOptRuleBlacklist struct {
// contains filtered or unexported fields
}
ReloadOptRuleBlacklist reloads the data from opt_rule_blacklist table.
func (*ReloadOptRuleBlacklist) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ReloadOptRuleBlacklist) ResolveIndices ¶
func (p *ReloadOptRuleBlacklist) ResolveIndices() (err error)
func (*ReloadOptRuleBlacklist) Schema ¶
func (s *ReloadOptRuleBlacklist) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ReloadOptRuleBlacklist) SetOutputNames ¶
func (*ReloadOptRuleBlacklist) SetSchema ¶
func (s *ReloadOptRuleBlacklist) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type SQLBindOpType ¶
type SQLBindOpType int
SQLBindOpType repreents the SQL bind type
const ( // OpSQLBindCreate represents the operation to create a SQL bind. OpSQLBindCreate SQLBindOpType = iota // OpSQLBindDrop represents the operation to drop a SQL bind. OpSQLBindDrop // OpFlushBindings is used to flush plan bindings. OpFlushBindings // OpCaptureBindings is used to capture plan bindings. OpCaptureBindings // OpEvolveBindings is used to evolve plan binding. OpEvolveBindings // OpReloadBindings is used to reload plan binding. OpReloadBindings )
type SQLBindPlan ¶
type SQLBindPlan struct { SQLBindOp SQLBindOpType NormdOrigSQL string BindSQL string IsGlobal bool BindStmt ast.StmtNode Db string Charset string Collation string // contains filtered or unexported fields }
SQLBindPlan represents a plan for SQL bind.
func (*SQLBindPlan) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*SQLBindPlan) ResolveIndices ¶
func (p *SQLBindPlan) ResolveIndices() (err error)
func (*SQLBindPlan) Schema ¶
func (s *SQLBindPlan) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*SQLBindPlan) SetOutputNames ¶
func (*SQLBindPlan) SetSchema ¶
func (s *SQLBindPlan) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type SelectInto ¶
type SelectInto struct { TargetPlan Plan IntoOpt *ast.SelectIntoOption // contains filtered or unexported fields }
SelectInto represents a select-into plan.
func (*SelectInto) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*SelectInto) ResolveIndices ¶
func (p *SelectInto) ResolveIndices() (err error)
func (*SelectInto) Schema ¶
func (s *SelectInto) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*SelectInto) SetOutputNames ¶
func (*SelectInto) SetSchema ¶
func (s *SelectInto) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Set ¶
type Set struct { VarAssigns []*expression.VarAssignment // contains filtered or unexported fields }
Set represents a plan for set stmt.
func (*Set) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Set) ResolveIndices ¶
func (p *Set) ResolveIndices() (err error)
func (*Set) Schema ¶
func (s *Set) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Set) SetOutputNames ¶
func (*Set) SetSchema ¶
func (s *Set) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ShowContents ¶
type ShowContents struct { Tp ast.ShowStmtType // Databases/Tables/Columns/.... DBName string Table *ast.TableName // Used for showing columns. Column *ast.ColumnName // Used for `desc table column`. IndexName model.CIStr Flag int // Some flag parsed from sql, such as FULL. User *auth.UserIdentity // Used for show grants. Roles []*auth.RoleIdentity // Used for show grants. Full bool IfNotExists bool // Used for `show create database if not exists`. GlobalScope bool // Used by show variables. Extended bool // Used for `show extended columns from ...` }
ShowContents stores the contents for the `SHOW` statement.
type ShowDDL ¶
type ShowDDL struct {
// contains filtered or unexported fields
}
ShowDDL is for showing DDL information.
func (*ShowDDL) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ShowDDL) ResolveIndices ¶
func (p *ShowDDL) ResolveIndices() (err error)
func (*ShowDDL) Schema ¶
func (s *ShowDDL) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ShowDDL) SetOutputNames ¶
func (*ShowDDL) SetSchema ¶
func (s *ShowDDL) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ShowDDLJobQueries ¶
type ShowDDLJobQueries struct { JobIDs []int64 // contains filtered or unexported fields }
ShowDDLJobQueries is for showing DDL job queries sql.
func (*ShowDDLJobQueries) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ShowDDLJobQueries) ResolveIndices ¶
func (p *ShowDDLJobQueries) ResolveIndices() (err error)
func (*ShowDDLJobQueries) Schema ¶
func (s *ShowDDLJobQueries) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ShowDDLJobQueries) SetOutputNames ¶
func (*ShowDDLJobQueries) SetSchema ¶
func (s *ShowDDLJobQueries) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ShowNextRowID ¶
ShowNextRowID is for showing the next global row ID.
func (*ShowNextRowID) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ShowNextRowID) ResolveIndices ¶
func (p *ShowNextRowID) ResolveIndices() (err error)
func (*ShowNextRowID) Schema ¶
func (s *ShowNextRowID) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ShowNextRowID) SetOutputNames ¶
func (*ShowNextRowID) SetSchema ¶
func (s *ShowNextRowID) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type ShowSlow ¶
ShowSlow is for showing slow queries.
func (*ShowSlow) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*ShowSlow) ResolveIndices ¶
func (p *ShowSlow) ResolveIndices() (err error)
func (*ShowSlow) Schema ¶
func (s *ShowSlow) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*ShowSlow) SetOutputNames ¶
func (*ShowSlow) SetSchema ¶
func (s *ShowSlow) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Simple ¶
Simple represents a simple statement plan which doesn't need any optimization.
func (*Simple) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Simple) ResolveIndices ¶
func (p *Simple) ResolveIndices() (err error)
func (*Simple) Schema ¶
func (s *Simple) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Simple) SetOutputNames ¶
func (*Simple) SetSchema ¶
func (s *Simple) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type SlowQueryExtractor ¶
type SlowQueryExtractor struct { SkipRequest bool StartTime time.Time EndTime time.Time // Enable is true means the executor should use the time range to locate the slow-log file that need to be parsed. // Enable is false, means the executor should keep the behavior compatible with before, which is only parse the // current slow-log file. Enable bool // contains filtered or unexported fields }
SlowQueryExtractor is used to extract some predicates of `slow_query`
func (*SlowQueryExtractor) Extract ¶
func (e *SlowQueryExtractor) Extract( ctx sessionctx.Context, schema *expression.Schema, names []*types.FieldName, predicates []expression.Expression, ) []expression.Expression
Extract implements the MemTablePredicateExtractor Extract interface
type SplitRegion ¶
type SplitRegion struct { TableInfo *model.TableInfo PartitionNames []model.CIStr IndexInfo *model.IndexInfo Lower []types.Datum Upper []types.Datum Num int ValueLists [][]types.Datum // contains filtered or unexported fields }
SplitRegion represents a split regions plan.
func (*SplitRegion) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*SplitRegion) ResolveIndices ¶
func (p *SplitRegion) ResolveIndices() (err error)
func (*SplitRegion) Schema ¶
func (s *SplitRegion) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*SplitRegion) SetOutputNames ¶
func (*SplitRegion) SetSchema ¶
func (s *SplitRegion) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type SplitRegionStatus ¶
type SplitRegionStatus struct { Table table.Table IndexInfo *model.IndexInfo // contains filtered or unexported fields }
SplitRegionStatus represents a split regions status plan.
func (*SplitRegionStatus) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*SplitRegionStatus) ResolveIndices ¶
func (p *SplitRegionStatus) ResolveIndices() (err error)
func (*SplitRegionStatus) Schema ¶
func (s *SplitRegionStatus) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*SplitRegionStatus) SetOutputNames ¶
func (*SplitRegionStatus) SetSchema ¶
func (s *SplitRegionStatus) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type TblColPosInfo ¶
type TblColPosInfo struct { TblID int64 // Start and End represent the ordinal range [Start, End) of the consecutive columns. Start, End int // HandleOrdinal represents the ordinal of the handle column. HandleOrdinal int }
TblColPosInfo represents an mapper from column index to handle index.
type TblColPosInfoSlice ¶
type TblColPosInfoSlice []TblColPosInfo
TblColPosInfoSlice attaches the methods of sort.Interface to []TblColPosInfos sorting in increasing order.
func (TblColPosInfoSlice) FindHandle ¶
func (c TblColPosInfoSlice) FindHandle(colOrdinal int) (int, bool)
FindHandle finds the ordinal of the corresponding handle column.
func (TblColPosInfoSlice) Len ¶
func (c TblColPosInfoSlice) Len() int
Len implements sort.Interface#Len.
func (TblColPosInfoSlice) Less ¶
func (c TblColPosInfoSlice) Less(i, j int) bool
Less implements sort.Interface#Less.
func (TblColPosInfoSlice) Swap ¶
func (c TblColPosInfoSlice) Swap(i, j int)
Swap implements sort.Interface#Swap.
type TiKVSingleGather ¶
type TiKVSingleGather struct { Source *DataSource // IsIndexGather marks if this TiKVSingleGather gathers tuples from an IndexScan. // in implementation phase, we need this flag to determine whether to generate // PhysicalTableReader or PhysicalIndexReader. IsIndexGather bool Index *model.IndexInfo // contains filtered or unexported fields }
TiKVSingleGather is a leaf logical operator of TiDB layer to gather tuples from TiKV regions.
func (*TiKVSingleGather) BuildKeyInfo ¶
func (tg *TiKVSingleGather) BuildKeyInfo(selfSchema *expression.Schema, childSchema []*expression.Schema)
BuildKeyInfo implements LogicalPlan BuildKeyInfo interface.
func (*TiKVSingleGather) ExplainInfo ¶
func (p *TiKVSingleGather) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*TiKVSingleGather) GetPhysicalIndexReader ¶
func (sg *TiKVSingleGather) GetPhysicalIndexReader(schema *expression.Schema, stats *property.StatsInfo, props ...*property.PhysicalProperty) *PhysicalIndexReader
GetPhysicalIndexReader returns PhysicalIndexReader for logical TiKVSingleGather.
func (*TiKVSingleGather) GetPhysicalTableReader ¶
func (sg *TiKVSingleGather) GetPhysicalTableReader(schema *expression.Schema, stats *property.StatsInfo, props ...*property.PhysicalProperty) *PhysicalTableReader
GetPhysicalTableReader returns PhysicalTableReader for logical TiKVSingleGather.
func (TiKVSingleGather) Init ¶
func (sg TiKVSingleGather) Init(ctx sessionctx.Context, offset int) *TiKVSingleGather
Init initializes TiKVSingleGather.
func (*TiKVSingleGather) OutputNames ¶
func (*TiKVSingleGather) PreparePossibleProperties ¶
func (p *TiKVSingleGather) PreparePossibleProperties(schema *expression.Schema, childrenProperties ...[][]*expression.Column) [][]*expression.Column
PreparePossibleProperties implements LogicalPlan PreparePossibleProperties interface.
func (*TiKVSingleGather) Schema ¶
func (s *TiKVSingleGather) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*TiKVSingleGather) SetOutputNames ¶
func (*TiKVSingleGather) SetSchema ¶
func (s *TiKVSingleGather) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Trace ¶
Trace represents a trace plan.
func (*Trace) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Trace) ResolveIndices ¶
func (p *Trace) ResolveIndices() (err error)
func (*Trace) Schema ¶
func (s *Trace) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Trace) SetOutputNames ¶
func (*Trace) SetSchema ¶
func (s *Trace) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type Update ¶
type Update struct { OrderedList []*expression.Assignment AllAssignmentsAreConstant bool SelectPlan PhysicalPlan TblColPosInfos TblColPosInfoSlice // contains filtered or unexported fields }
Update represents Update plan.
func (*Update) OutputNames ¶
OutputNames returns the outputting names of each column.
func (*Update) ResolveIndices ¶
ResolveIndices implements Plan interface.
func (*Update) Schema ¶
func (s *Update) Schema() *expression.Schema
Schema implements the Plan.Schema interface.
func (*Update) SetOutputNames ¶
func (*Update) SetSchema ¶
func (s *Update) SetSchema(schema *expression.Schema)
SetSchema implements the Plan.SetSchema interface.
type WindowFrame ¶
type WindowFrame struct { Type ast.FrameType Start *FrameBound End *FrameBound }
WindowFrame represents a window function frame.
type WindowFuncExtractor ¶
type WindowFuncExtractor struct {
// contains filtered or unexported fields
}
WindowFuncExtractor visits Expr tree. It converts ColunmNameExpr to WindowFuncExpr and collects WindowFuncExpr.
Source Files ¶
- cache.go
- cacheable_checker.go
- common_plans.go
- encode.go
- errors.go
- exhaust_physical_plans.go
- explain.go
- expression_rewriter.go
- find_best_task.go
- hashcode.go
- hints.go
- initialize.go
- logical_plan_builder.go
- logical_plans.go
- memtable_predicate_extractor.go
- mock.go
- optimizer.go
- pb_to_plan.go
- physical_plans.go
- plan.go
- plan_to_pb.go
- planbuilder.go
- point_get_plan.go
- preprocess.go
- property_cols_prune.go
- resolve_indices.go
- rule_aggregation_elimination.go
- rule_aggregation_push_down.go
- rule_build_key_info.go
- rule_column_pruning.go
- rule_decorrelate.go
- rule_eliminate_projection.go
- rule_generate_column_substitute.go
- rule_inject_extra_projection.go
- rule_join_elimination.go
- rule_join_reorder.go
- rule_join_reorder_dp.go
- rule_join_reorder_greedy.go
- rule_max_min_eliminate.go
- rule_partition_processor.go
- rule_predicate_push_down.go
- rule_topn_push_down.go
- stats.go
- stringer.go
- task.go
- trace.go
- util.go