property

package
v0.0.0-...-d60a1a2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

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

func NewSimpleStats(rowCount float64) *StatsInfo

NewSimpleStats creates a simple StatsInfo with rowCount.

func (*StatsInfo) Count

func (s *StatsInfo) Count() int64

Count gets the RowCount in the StatsInfo.

func (*StatsInfo) Scale

func (s *StatsInfo) Scale(factor float64) *StatsInfo

Scale receives a selectivity and multiplies it with RowCount and Cardinality.

func (*StatsInfo) ScaleByExpectCnt

func (s *StatsInfo) ScaleByExpectCnt(expectCnt float64) *StatsInfo

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.

func (*StatsInfo) String

func (s *StatsInfo) String() string

String implements fmt.Stringer interface.

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
)

func (TaskType) String

func (t TaskType) String() string

String implements fmt.Stringer interface.

Jump to

Keyboard shortcuts

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