Documentation ¶
Index ¶
- Constants
- Variables
- func BuildIndexRange(sc *variable.StatementContext, tblInfo *model.TableInfo, ...) ([]*types.IndexRange, error)
- func BuildRange(sc *variable.StatementContext, conds []expression.Expression, rangeType int, ...) (retRanges []types.Range, _ error)
- func BuildTableRange(accessConditions []expression.Expression, sc *variable.StatementContext) ([]types.IntColumnRange, error)
- func DetachColumnConditions(conditions []expression.Expression, colName model.CIStr) ([]expression.Expression, []expression.Expression)
- func DetachCondsForSelectivity(conds []expression.Expression, rangeType int, cols []*expression.Column, ...) (accessConditions, otherConditions []expression.Expression)
- func DetachIndexConditions(conditions []expression.Expression, cols []*expression.Column, lengths []int) (accessConds []expression.Expression, filterConds []expression.Expression)
- func DetachIndexFilterConditions(conditions []expression.Expression, indexColumns []*model.IndexColumn, ...) ([]expression.Expression, []expression.Expression)
- func DetachIndexScanConditions(conditions []expression.Expression, index *model.IndexInfo) (accessConds []expression.Expression, filterConds []expression.Expression, ...)
- func FullIndexRange() []*types.IndexRange
- func FullIntRange() []types.IntColumnRange
- func Ranges2ColumnRanges(ranges []types.Range) []*types.ColumnRange
- func Ranges2IndexRanges(ranges []types.Range) []*types.IndexRange
- func Ranges2IntRanges(ranges []types.Range) []types.IntColumnRange
Constants ¶
const ( IntRangeType = iota ColumnRangeType IndexRangeType )
Range type.
Error codes.
Variables ¶
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.