index

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index interface {
	// Return the metadata object associated with the index
	GetMetadata() *IndexMetadata
	GetIndexColumnCount() uint32
	GetName() *string
	GetTupleSchema() *schema.Schema
	GetKeyAttrs() []uint32
	///////////////////////////////////////////////////////////////////
	// Point Modification
	///////////////////////////////////////////////////////////////////
	// designed for secondary indexes.
	InsertEntry(*tuple.Tuple, page.RID, interface{})
	// delete the index entry linked to given tuple
	DeleteEntry(*tuple.Tuple, page.RID, interface{})
	// update entry. internally, delete first entry and insert seconde entry atomically
	UpdateEntry(*tuple.Tuple, page.RID, *tuple.Tuple, page.RID, interface{})
	ScanKey(*tuple.Tuple, interface{}) []page.RID
	// pass start key and end key. nil is also ok.
	GetRangeScanIterator(*tuple.Tuple, *tuple.Tuple, interface{}) IndexRangeScanIterator
}

type IndexMetadata

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

func NewIndexMetadata

func NewIndexMetadata(index_name string, table_name string, tuple_schema *schema.Schema,
	key_attrs []uint32) *IndexMetadata

func (*IndexMetadata) GetIndexColumnCount

func (im *IndexMetadata) GetIndexColumnCount() uint32

Return the number of columns inside index key (not in tuple key) Note that this must be defined inside the cpp source file because it uses the member of catalog::Schema which is not known here

func (*IndexMetadata) GetKeyAttrs

func (im *IndexMetadata) GetKeyAttrs() []uint32

Returns the mapping relation between indexed columns and base table columns

func (*IndexMetadata) GetName

func (im *IndexMetadata) GetName() *string

func (*IndexMetadata) GetTableName

func (im *IndexMetadata) GetTableName() *string

func (*IndexMetadata) GetTupleSchema

func (im *IndexMetadata) GetTupleSchema() *schema.Schema

Returns a schema object pointer that represents the indexed key

type IndexRangeScanIterator added in v0.0.2

type IndexRangeScanIterator interface {
	Next() (bool, error, *types.Value, *page.RID)
}

type LinearProbeHashTableIndex

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

func NewLinearProbeHashTableIndex

func NewLinearProbeHashTableIndex(metadata *IndexMetadata, buffer_pool_manager *buffer.BufferPoolManager, col_idx uint32,
	num_buckets int, headerPageId types.PageID) *LinearProbeHashTableIndex

func (*LinearProbeHashTableIndex) DeleteEntry

func (htidx *LinearProbeHashTableIndex) DeleteEntry(key *tuple.Tuple, rid page.RID, transaction interface{})

func (*LinearProbeHashTableIndex) GetHeaderPageId added in v0.0.2

func (htidx *LinearProbeHashTableIndex) GetHeaderPageId() types.PageID

func (*LinearProbeHashTableIndex) GetIndexColumnCount

func (htidx *LinearProbeHashTableIndex) GetIndexColumnCount() uint32

func (*LinearProbeHashTableIndex) GetKeyAttrs

func (htidx *LinearProbeHashTableIndex) GetKeyAttrs() []uint32

func (*LinearProbeHashTableIndex) GetMetadata

func (htidx *LinearProbeHashTableIndex) GetMetadata() *IndexMetadata

Return the metadata object associated with the index

func (*LinearProbeHashTableIndex) GetName

func (htidx *LinearProbeHashTableIndex) GetName() *string

func (*LinearProbeHashTableIndex) GetRangeScanIterator added in v0.0.2

func (htidx *LinearProbeHashTableIndex) GetRangeScanIterator(startkey *tuple.Tuple, endKey *tuple.Tuple, txn interface{}) IndexRangeScanIterator

func (*LinearProbeHashTableIndex) GetTupleSchema

func (htidx *LinearProbeHashTableIndex) GetTupleSchema() *schema.Schema

func (*LinearProbeHashTableIndex) InsertEntry

func (htidx *LinearProbeHashTableIndex) InsertEntry(key *tuple.Tuple, rid page.RID, transaction interface{})

func (*LinearProbeHashTableIndex) ScanKey

func (htidx *LinearProbeHashTableIndex) ScanKey(key *tuple.Tuple, transaction interface{}) []page.RID

func (*LinearProbeHashTableIndex) UpdateEntry added in v0.0.2

func (htidx *LinearProbeHashTableIndex) UpdateEntry(oldKey *tuple.Tuple, oldRID page.RID, newKey *tuple.Tuple, newRID page.RID, transaction interface{})

type SkipListIndex added in v0.0.2

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

func NewSkipListIndex added in v0.0.2

func NewSkipListIndex(metadata *IndexMetadata, buffer_pool_manager *buffer.BufferPoolManager, col_idx uint32) *SkipListIndex

func (*SkipListIndex) DeleteEntry added in v0.0.2

func (slidx *SkipListIndex) DeleteEntry(key *tuple.Tuple, rid page.RID, txn interface{})

func (*SkipListIndex) GetHeaderPageId added in v0.0.2

func (slidx *SkipListIndex) GetHeaderPageId() types.PageID

func (*SkipListIndex) GetIndexColumnCount added in v0.0.2

func (slidx *SkipListIndex) GetIndexColumnCount() uint32

func (*SkipListIndex) GetKeyAttrs added in v0.0.2

func (slidx *SkipListIndex) GetKeyAttrs() []uint32

func (*SkipListIndex) GetMetadata added in v0.0.2

func (slidx *SkipListIndex) GetMetadata() *IndexMetadata

Return the metadata object associated with the index

func (*SkipListIndex) GetName added in v0.0.2

func (slidx *SkipListIndex) GetName() *string

func (*SkipListIndex) GetRangeScanIterator added in v0.0.2

func (slidx *SkipListIndex) GetRangeScanIterator(start_key *tuple.Tuple, end_key *tuple.Tuple, transaction interface{}) IndexRangeScanIterator

get iterator which iterates entry in key sorted order and iterates specified key range. when start_key arg is nil , start point is head of entry list. when end_key, end point is tail of the list Attention: returned itr's containing keys are string type Value which is constructed with byte arr of concatenated original key and value

func (*SkipListIndex) GetTupleSchema added in v0.0.2

func (slidx *SkipListIndex) GetTupleSchema() *schema.Schema

func (*SkipListIndex) InsertEntry added in v0.0.2

func (slidx *SkipListIndex) InsertEntry(key *tuple.Tuple, rid page.RID, txn interface{})

func (*SkipListIndex) ScanKey added in v0.0.2

func (slidx *SkipListIndex) ScanKey(key *tuple.Tuple, txn interface{}) []page.RID

func (*SkipListIndex) UpdateEntry added in v0.0.2

func (slidx *SkipListIndex) UpdateEntry(oldKey *tuple.Tuple, oldRID page.RID, newKey *tuple.Tuple, newRID page.RID, txn interface{})

type UniqSkipListIndex added in v0.0.4

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

func NewUniqSkipListIndex added in v0.0.4

func NewUniqSkipListIndex(metadata *IndexMetadata, buffer_pool_manager *buffer.BufferPoolManager, col_idx uint32) *UniqSkipListIndex

func (*UniqSkipListIndex) DeleteEntry added in v0.0.4

func (slidx *UniqSkipListIndex) DeleteEntry(key *tuple.Tuple, rid page.RID, transaction interface{})

func (*UniqSkipListIndex) GetHeaderPageId added in v0.0.4

func (slidx *UniqSkipListIndex) GetHeaderPageId() types.PageID

func (*UniqSkipListIndex) GetIndexColumnCount added in v0.0.4

func (slidx *UniqSkipListIndex) GetIndexColumnCount() uint32

func (*UniqSkipListIndex) GetKeyAttrs added in v0.0.4

func (slidx *UniqSkipListIndex) GetKeyAttrs() []uint32

func (*UniqSkipListIndex) GetMetadata added in v0.0.4

func (slidx *UniqSkipListIndex) GetMetadata() *IndexMetadata

Return the metadata object associated with the index

func (*UniqSkipListIndex) GetName added in v0.0.4

func (slidx *UniqSkipListIndex) GetName() *string

func (*UniqSkipListIndex) GetRangeScanIterator added in v0.0.4

func (slidx *UniqSkipListIndex) GetRangeScanIterator(start_key *tuple.Tuple, end_key *tuple.Tuple, transaction interface{}) IndexRangeScanIterator

get iterator which iterates entry in key sorted order and iterates specified key range. when start_key arg is nil , start point is head of entry list. when end_key, end point is tail of the list

func (*UniqSkipListIndex) GetTupleSchema added in v0.0.4

func (slidx *UniqSkipListIndex) GetTupleSchema() *schema.Schema

func (*UniqSkipListIndex) InsertEntry added in v0.0.4

func (slidx *UniqSkipListIndex) InsertEntry(key *tuple.Tuple, rid page.RID, transaction interface{})

func (*UniqSkipListIndex) ScanKey added in v0.0.4

func (slidx *UniqSkipListIndex) ScanKey(key *tuple.Tuple, transaction interface{}) []page.RID

func (*UniqSkipListIndex) UpdateEntry added in v0.0.4

func (slidx *UniqSkipListIndex) UpdateEntry(oldKey *tuple.Tuple, oldRID page.RID, newKey *tuple.Tuple, newRID page.RID, transaction interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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