ranger

package
v0.0.0-...-6dbff61 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CodeUnsupportedType terror.ErrCode = 1
)

Error codes.

Variables

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

Error instances.

View Source
var FullRange = []point{
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
}

FullRange is (-∞, +∞).

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 BuildTableRange

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

BuildTableRange will build range of pk for PhysicalTableScan

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 DetachTableScanConditions

func DetachTableScanConditions(conditions []expression.Expression, pkName model.CIStr) ([]expression.Expression, []expression.Expression)

DetachTableScanConditions distinguishes between access conditions and filter conditions from conditions.

Types

type Builder

type Builder struct {
	Sc *variable.StatementContext
	// contains filtered or unexported fields
}

Builder is the range builder struct.

func (*Builder) BuildIndexRanges

func (r *Builder) BuildIndexRanges(rangePoints []point, tp *types.FieldType) []*types.IndexRange

BuildIndexRanges build index ranges from range points. Only the first column in the index is built, extra column ranges will be appended by appendIndexRanges.

func (*Builder) BuildTableRanges

func (r *Builder) BuildTableRanges(rangePoints []point) []types.IntColumnRange

BuildTableRanges will construct the range slice with the given range points

Jump to

Keyboard shortcuts

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