Documentation ¶
Index ¶
- Constants
- Variables
- func BuildIndexRange(sc *variable.StatementContext, tblInfo *model.TableInfo, ...) ([]*types.IndexRange, error)
- func BuildTableRange(accessConditions []expression.Expression, sc *variable.StatementContext) ([]types.IntColumnRange, error)
- 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 DetachTableScanConditions(conditions []expression.Expression, pkName model.CIStr) ([]expression.Expression, []expression.Expression)
- type Builder
Constants ¶
const (
CodeUnsupportedType terror.ErrCode = 1
)
Error codes.
Variables ¶
var (
ErrUnsupportedType = terror.ClassOptimizerPlan.New(CodeUnsupportedType, "Unsupported type")
)
Error instances.
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