index

package
v1.2208.0-pre3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanOptimize added in v1.2202.0

func CanOptimize(l *logrus.Entry, ctx *session.Context, node ast.Node) bool

CanOptimize do some pre check on node.

func WithCalculateCardinalityMaxRow

func WithCalculateCardinalityMaxRow(row int) optimizerOption

func WithCompositeIndexMaxColumn

func WithCompositeIndexMaxColumn(column int) optimizerOption

func WithCreateIndexStatement

func WithCreateIndexStatement(f func(tableName string, columns ...string) string) optimizerOption

Types

type OptimizeResult

type OptimizeResult struct {
	TableName      string
	IndexedColumns []string

	Reason string
}

type Optimizer

type Optimizer struct {
	*session.Context
	// contains filtered or unexported fields
}

func NewOptimizer

func NewOptimizer(log *logrus.Entry, ctx *session.Context, opts ...optimizerOption) *Optimizer

func (*Optimizer) Optimize

func (o *Optimizer) Optimize(ctx context.Context, selectStmt *ast.SelectStmt) ([]*OptimizeResult, error)

Optimize give index advice for the select statement.

Jump to

Keyboard shortcuts

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