util

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPath

type AccessPath struct {
	Index          *model.IndexInfo
	FullIdxCols    []*expression.Column
	FullIdxColLens []int
	IdxCols        []*expression.Column
	IdxColLens     []int
	Ranges         []*ranger.Range
	// CountAfterAccess is the row count after we apply range seek and before we use other filter to filter data.
	// For index merge path, CountAfterAccess is the row count after partial paths and before we apply table filters.
	CountAfterAccess float64
	// CountAfterIndex is the row count after we apply filters on index and before we apply the table filters.
	CountAfterIndex float64
	AccessConds     []expression.Expression
	EqCondCount     int
	EqOrInCondCount int
	IndexFilters    []expression.Expression
	TableFilters    []expression.Expression
	// PartialIndexPaths store all index access paths.
	// If there are extra filters, store them in TableFilters.
	PartialIndexPaths []*AccessPath

	IsDNFCond bool

	// IsTiFlashGlobalRead indicates whether this path is a remote read path for tiflash
	IsTiFlashGlobalRead bool

	// IsIntHandlePath indicates whether this path is table path.
	IsIntHandlePath    bool
	IsCommonHandlePath bool
	// Forced means this path is generated by `use/force index()`.
	Forced bool
}

AccessPath indicates the way we access a table: by using single index, or by using multiple indexes, or just by using table scan.

func (*AccessPath) IsTablePath

func (path *AccessPath) IsTablePath() bool

IsTablePath returns true if it's IntHandlePath or CommonHandlePath.

func (*AccessPath) SplitCorColAccessCondFromFilters

func (path *AccessPath) SplitCorColAccessCondFromFilters(ctx sessionctx.Context, eqOrInCount int) (access, remained []expression.Expression)

SplitCorColAccessCondFromFilters move the necessary filter in the form of index_col = corrlated_col to access conditions.

type ByItems

type ByItems struct {
	Expr expression.Expression
	Desc bool
}

ByItems wraps a "by" item.

func (*ByItems) Clone

func (by *ByItems) Clone() *ByItems

Clone makes a copy of ByItems.

func (*ByItems) Equal

func (by *ByItems) Equal(ctx sessionctx.Context, other *ByItems) bool

Equal checks whether two ByItems are equal.

func (*ByItems) String

func (by *ByItems) 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