ranger

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntRangeType = iota
	ColumnRangeType
	IndexRangeType
)

Range type.

View Source
const (
	CodeUnsupportedType terror.ErrCode = 1
)

Error codes.

Variables

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

Error instances.

Functions

func BuildIndexRange

func BuildIndexRange(sc *variable.StatementContext, tblInfo *model.TableInfo, index *model.IndexInfo,
	accessInAndEqCount int, accessCondition []expression.Expression) ([]*types.IndexRange, error)

BuildIndexRange will build range of index for PhysicalIndexScan

func BuildRange

func BuildRange(sc *variable.StatementContext, conds []expression.Expression, rangeType int, cols []*expression.Column,
	lengths []int) (retRanges []types.Range, _ error)

BuildRange is a method which can calculate IntColumnRange, ColumnRange, IndexRange.

func BuildTableRange

func BuildTableRange(accessConditions []expression.Expression, sc *variable.StatementContext) ([]types.IntColumnRange, error)

BuildTableRange will build range of pk for PhysicalTableScan

func DetachColumnConditions

func DetachColumnConditions(conditions []expression.Expression, colName model.CIStr) ([]expression.Expression, []expression.Expression)

DetachColumnConditions distinguishes between access conditions and filter conditions from conditions.

func DetachCondsForSelectivity

func DetachCondsForSelectivity(conds []expression.Expression, rangeType int, cols []*expression.Column,
	lengths []int) (accessConditions, otherConditions []expression.Expression)

DetachCondsForSelectivity detaches the conditions used for range calculation from other useless conditions.

func DetachIndexConditions

func DetachIndexConditions(conditions []expression.Expression, cols []*expression.Column, lengths []int) (accessConds []expression.Expression,
	filterConds []expression.Expression)

DetachIndexConditions will detach the index filters from table filters.

func DetachIndexFilterConditions

func DetachIndexFilterConditions(conditions []expression.Expression, indexColumns []*model.IndexColumn, table *model.TableInfo) ([]expression.Expression, []expression.Expression)

DetachIndexFilterConditions will detach the access conditions from other conditions.

func DetachIndexScanConditions

func DetachIndexScanConditions(conditions []expression.Expression, index *model.IndexInfo) (accessConds []expression.Expression,
	filterConds []expression.Expression, accessEqualCount int, accessInAndEqCount int)

DetachIndexScanConditions will detach the index filters from table filters.

func FullIndexRange

func FullIndexRange() []*types.IndexRange

FullIndexRange is (-∞, +∞) for IndexRange.

func FullIntRange

func FullIntRange() []types.IntColumnRange

FullIntRange is (-∞, +∞) for IntColumnRange.

func Ranges2ColumnRanges

func Ranges2ColumnRanges(ranges []types.Range) []*types.ColumnRange

Ranges2ColumnRanges changes []types.Range to []*types.ColumnRange

func Ranges2IndexRanges

func Ranges2IndexRanges(ranges []types.Range) []*types.IndexRange

Ranges2IndexRanges changes []types.Range to []*types.IndexRange

func Ranges2IntRanges

func Ranges2IntRanges(ranges []types.Range) []types.IntColumnRange

Ranges2IntRanges changes []types.Range to []types.IntColumnRange

Types

This section is empty.

Jump to

Keyboard shortcuts

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