Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PhysicalProperty ¶
type PhysicalProperty struct {
Cols []*expression.Column
Desc bool
// TaskTp means the type of task that an operator requires.
//
// It needs to be specified because two different tasks can't be compared
// with cost directly. e.g. If a copTask takes less cost than a rootTask,
// we can't sure that we must choose the former one. Because the copTask
// must be finished and increase its cost in sometime, but we can't make
// sure the finishing time. So the best way to let the comparison fair is
// to add TaskType to required property.
TaskTp TaskType
// ExpectedCnt means this operator may be closed after fetching ExpectedCnt
// records.
ExpectedCnt float64
// whether need to enforce property.
Enforced bool
// contains filtered or unexported fields
}
PhysicalProperty stands for the required physical property by parents. It contains the orders, if the order is desc and the task types.
func (*PhysicalProperty) AllColsFromSchema ¶
func (p *PhysicalProperty) AllColsFromSchema(schema *expression.Schema) bool
AllColsFromSchema checks whether all the columns needed by this physical property can be found in the given schema.
func (*PhysicalProperty) HashCode ¶
func (p *PhysicalProperty) HashCode() []byte
HashCode calculates hash code for a PhysicalProperty object.
func (*PhysicalProperty) IsEmpty ¶
func (p *PhysicalProperty) IsEmpty() bool
IsEmpty checks whether the order property is empty.
func (*PhysicalProperty) IsPrefix ¶
func (p *PhysicalProperty) IsPrefix(prop *PhysicalProperty) bool
IsPrefix checks whether the order property is the prefix of another.
func (*PhysicalProperty) String ¶
func (p *PhysicalProperty) String() string
String implements fmt.Stringer interface. Just for test.
type StatsInfo ¶
type StatsInfo struct {
RowCount float64
Cardinality []float64
HistColl statistics.HistColl
// UsePseudoStats indicates whether the StatsInfo is calculated using the
// pseudo statistics on a table.
UsePseudoStats bool
}
StatsInfo stores the basic information of statistics for the plan's output. It is used for cost estimation.
func NewSimpleStats ¶
NewSimpleStats creates a simple StatsInfo with rowCount.
func (*StatsInfo) Scale ¶
Scale receives a selectivity and multiplies it with RowCount and Cardinality.
func (*StatsInfo) ScaleByExpectCnt ¶
ScaleByExpectCnt tries to Scale StatsInfo to an expectCnt which must be smaller than the derived cnt. TODO: try to use a better way to do this.
type TaskType ¶
type TaskType int
TaskType is the type of execution task.
const ( // RootTaskType stands for the tasks that executed in the TiDB layer. RootTaskType TaskType = iota // CopSingleReadTaskType stands for the a TableScan or IndexScan tasks // executed in the coprocessor layer. CopSingleReadTaskType // CopDoubleReadTaskType stands for the a IndexLookup tasks executed in the // coprocessor layer. CopDoubleReadTaskType )