index

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitConjunction

func SplitConjunction(expr sql.Expression) []sql.Expression

SplitConjunction breaks AND expressions into their left and right parts, recursively.

func SplitConjunctions

func SplitConjunctions(exprs []sql.Expression) []sql.Expression

SplitConjunctions performs the same operation as SplitConjunction, except that it applies to a slice.

func SplitDisjunction

func SplitDisjunction(expr sql.Expression) []sql.Expression

SplitDisjunction breaks OR expressions into their left and right parts, recursively. Also handles expressions that can be approximated as OR expressions, such as IN for tuples.

func SplitDisjunctions

func SplitDisjunctions(exprs []sql.Expression) []sql.Expression

SplitDisjunctions performs the same operation as SplitDisjunction, except that it applies to a slice.

Types

type DoltgresTable

type DoltgresTable struct {
	*sqle.DoltTable
}

DoltgresTable is a wrapper around a DoltTable that allows for indexing operations to use the correct indexing interface for Postgres compatibility.

func (*DoltgresTable) IndexedAccess

func (dt *DoltgresTable) IndexedAccess(lookup sql.IndexLookup) sql.IndexedTable

IndexedAccess implements the sql.IndexSearchableTable interface.

func (*DoltgresTable) LookupForExpressions

func (dt *DoltgresTable) LookupForExpressions(ctx *sql.Context, exprs ...sql.Expression) (sql.IndexLookup, *sql.FuncDepSet, sql.Expression, bool, error)

LookupForExpressions implements the sql.IndexSearchableTable interface.

func (*DoltgresTable) PreciseMatch

func (dt *DoltgresTable) PreciseMatch() bool

PreciseMatch implements the sql.IndexSearchableTable interface.

func (*DoltgresTable) SkipIndexCosting

func (dt *DoltgresTable) SkipIndexCosting() bool

SkipIndexCosting implements the sql.IndexSearchableTable interface.

func (*DoltgresTable) WithProjections

func (dt *DoltgresTable) WithProjections(colNames []string) sql.Table

WithProjections implements the sql.ProjectedTable interface.

type IndexBuilder

type IndexBuilder struct {
	// contains filtered or unexported fields
}

IndexBuilder builds an index following the same rules as a B-Tree index in Postgres.

func NewIndexBuilder

func NewIndexBuilder(ctx *sql.Context, indexes []sql.Index) (*IndexBuilder, error)

NewIndexBuilder creates a new IndexBuilder for the given indexes.

func (*IndexBuilder) AddExpression

func (ib *IndexBuilder) AddExpression(ctx *sql.Context, expr sql.Expression)

AddExpression adds the given expression to the builder.

func (*IndexBuilder) GetLookup

func (ib *IndexBuilder) GetLookup(ctx *sql.Context) sql.IndexLookup

GetLookup returns a fully-formed index lookup. If an index lookup could not be created, then it will contain a nil index.

type IndexedDoltgresTable

type IndexedDoltgresTable struct {
	*sqle.IndexedDoltTable
	// contains filtered or unexported fields
}

IndexedDoltgresTable is a DoltgresTable with an associated index.

func (*IndexedDoltgresTable) LookupPartitions

func (idt *IndexedDoltgresTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error)

LookupPartitions implements the sql.IndexedTable interface.

func (*IndexedDoltgresTable) PartitionRows

func (idt *IndexedDoltgresTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)

PartitionRows implements the sql.Table interface.

func (*IndexedDoltgresTable) Partitions

func (idt *IndexedDoltgresTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)

Partitions implements the sql.Table interface.

func (*IndexedDoltgresTable) PreciseMatch

func (idt *IndexedDoltgresTable) PreciseMatch() bool

PreciseMatch implements the sql.IndexSearchableTable interface.

func (*IndexedDoltgresTable) WithProjections

func (idt *IndexedDoltgresTable) WithProjections(colNames []string) sql.Table

WithProjections implements the sql.ProjectedTable interface.

type IndexedWritableDoltgresTable

type IndexedWritableDoltgresTable struct {
	*sqle.WritableIndexedDoltTable
	// contains filtered or unexported fields
}

IndexedWritableDoltgresTable is a WritableDoltgresTable with an associated index.

func (*IndexedWritableDoltgresTable) LookupPartitions

func (idt *IndexedWritableDoltgresTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error)

LookupPartitions implements the sql.IndexedTable interface.

func (*IndexedWritableDoltgresTable) PartitionRows

func (idt *IndexedWritableDoltgresTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)

PartitionRows implements the sql.Table interface.

func (*IndexedWritableDoltgresTable) Partitions

Partitions implements the sql.Table interface.

func (*IndexedWritableDoltgresTable) PreciseMatch

func (idt *IndexedWritableDoltgresTable) PreciseMatch() bool

PreciseMatch implements the sql.IndexSearchableTable interface.

func (*IndexedWritableDoltgresTable) WithProjections

func (idt *IndexedWritableDoltgresTable) WithProjections(colNames []string) sql.Table

WithProjections implements the sql.ProjectedTable interface.

type OperatorStrategyNumber

type OperatorStrategyNumber uint8

OperatorStrategyNumber corresponds to the strategy number used within an operator class. These are specifically for B-Tree indexes, as other index types use different numbers to represent their strategy types. https://www.postgresql.org/docs/current/sql-createopclass.html

const (
	OperatorStrategyNumber_Less OperatorStrategyNumber = iota + 1
	OperatorStrategyNumber_LessEquals
	OperatorStrategyNumber_Equals
	OperatorStrategyNumber_GreaterEquals
	OperatorStrategyNumber_Greater
)

func (OperatorStrategyNumber) IsMoreRestrictive

func (strategy OperatorStrategyNumber) IsMoreRestrictive(other OperatorStrategyNumber) bool

IsMoreRestrictive returns whether the calling strategy is more restrictive than the given strategy. The more restrictive strategy is assumed to match fewer rows, however this may not be true depending on the values involved.

type WritableDoltgresTable

type WritableDoltgresTable struct {
	*sqle.WritableDoltTable
}

WritableDoltgresTable is a wrapper around a WritableDoltTable that allows for indexing operations to use the correct indexing interface for Postgres compatibility.

func (*WritableDoltgresTable) IndexedAccess

func (dt *WritableDoltgresTable) IndexedAccess(lookup sql.IndexLookup) sql.IndexedTable

IndexedAccess implements the sql.IndexSearchableTable interface.

func (*WritableDoltgresTable) LookupForExpressions

func (dt *WritableDoltgresTable) LookupForExpressions(ctx *sql.Context, exprs ...sql.Expression) (sql.IndexLookup, *sql.FuncDepSet, sql.Expression, bool, error)

LookupForExpressions implements the sql.IndexSearchableTable interface.

func (*WritableDoltgresTable) PreciseMatch

func (dt *WritableDoltgresTable) PreciseMatch() bool

PreciseMatch implements the sql.IndexSearchableTable interface.

func (*WritableDoltgresTable) SkipIndexCosting

func (dt *WritableDoltgresTable) SkipIndexCosting() bool

SkipIndexCosting implements the sql.IndexSearchableTable interface.

func (*WritableDoltgresTable) WithProjections

func (dt *WritableDoltgresTable) WithProjections(colNames []string) sql.Table

WithProjections implements the sql.ProjectedTable interface.

Jump to

Keyboard shortcuts

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