index

package
v0.0.0-...-16e0698 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func BTreeSearchCost

func BTreeSearchCost(numBlocks, rpb int) int

func HashSearchCost

func HashSearchCost(numBlocks, rpb int) int

func NewIndexLayout

func NewIndexLayout(field schema.Field) *record.Layout

Types

type BTreeDir

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

func NewBTreeDir

func NewBTreeDir(tx *transaction.Transaction, blockID file.BlockID, layout *record.Layout) (*BTreeDir, error)

func (*BTreeDir) Close

func (btd *BTreeDir) Close() error

func (*BTreeDir) Dump

func (btd *BTreeDir) Dump(leafLayout *record.Layout, leafTableName string) (*BTreeDirDump, error)

func (*BTreeDir) Insert

func (btd *BTreeDir) Insert(e DirEntry) (*DirEntry, error)

func (*BTreeDir) InsertEntry

func (btd *BTreeDir) InsertEntry(e DirEntry) (*DirEntry, error)

func (*BTreeDir) MakeNewRoot

func (btd *BTreeDir) MakeNewRoot(e DirEntry) error

func (*BTreeDir) Search

func (btd *BTreeDir) Search(searchKey schema.Constant) (int32, error)

type BTreeDirDump

type BTreeDirDump struct {
	Level    int32
	Keys     []string
	Vals     []string
	Children []BTreeDirDump
}

func (BTreeDirDump) String

func (d BTreeDirDump) String() string

type BTreeIndex

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

func (*BTreeIndex) BeforeFirst

func (bti *BTreeIndex) BeforeFirst(searchKey schema.Constant) error

func (*BTreeIndex) Close

func (bti *BTreeIndex) Close() error

func (*BTreeIndex) DataRID

func (bti *BTreeIndex) DataRID() (schema.RID, error)

func (*BTreeIndex) Delete

func (bti *BTreeIndex) Delete(dataVal schema.Constant, dataRID schema.RID) error

func (*BTreeIndex) Dump

func (bti *BTreeIndex) Dump() (*BTreeDirDump, error)

func (*BTreeIndex) Insert

func (bti *BTreeIndex) Insert(dataVal schema.Constant, dataRID schema.RID) error

func (*BTreeIndex) Next

func (bti *BTreeIndex) Next() (bool, error)

type BTreeLeaf

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

func NewBTreeLeaf

func NewBTreeLeaf(tx *transaction.Transaction, blockID file.BlockID, layout *record.Layout, searchKey schema.Constant) (*BTreeLeaf, error)

func (*BTreeLeaf) Close

func (btl *BTreeLeaf) Close() error

func (*BTreeLeaf) DataRID

func (btl *BTreeLeaf) DataRID() (schema.RID, error)

func (*BTreeLeaf) Delete

func (btl *BTreeLeaf) Delete(rid schema.RID) error

func (*BTreeLeaf) Insert

func (btl *BTreeLeaf) Insert(rid schema.RID) (*DirEntry, error)

func (*BTreeLeaf) Next

func (btl *BTreeLeaf) Next() (bool, error)

type BTreePage

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

func NewBTreePage

func NewBTreePage(tx *transaction.Transaction, currentBlockID file.BlockID, layout *record.Layout) (*BTreePage, error)

func (*BTreePage) AppendNew

func (btp *BTreePage) AppendNew(flag int32) error

func (*BTreePage) ChildNum

func (btp *BTreePage) ChildNum(slot int32) (int32, error)

func (*BTreePage) Close

func (btp *BTreePage) Close() error

func (*BTreePage) DataRID

func (btp *BTreePage) DataRID(slot int32) (schema.RID, error)

func (*BTreePage) Delete

func (btp *BTreePage) Delete(slot int32) error

func (*BTreePage) FindSlotBefore

func (btp *BTreePage) FindSlotBefore(searchKey schema.Constant) (int32, error)

func (*BTreePage) Format

func (btp *BTreePage) Format(blockId file.BlockID, flag int32) error

func (*BTreePage) InsertDir

func (btp *BTreePage) InsertDir(slot int32, val schema.Constant, blockNum int32) error

func (*BTreePage) InsertLeaf

func (btp *BTreePage) InsertLeaf(slot int32, val schema.Constant, rid schema.RID) error

func (*BTreePage) IsFull

func (btp *BTreePage) IsFull() (bool, error)

func (*BTreePage) Split

func (btp *BTreePage) Split(splitPos int32, flag int32) (file.BlockID, error)

type Config

type Config struct {
	Initializer Initializer
	SearchCost  SearchCost
}

type DirEntry

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

type HashIndex

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

func (*HashIndex) BeforeFirst

func (h *HashIndex) BeforeFirst(searchKey schema.Constant) error

func (*HashIndex) Close

func (h *HashIndex) Close() error

func (*HashIndex) DataRID

func (h *HashIndex) DataRID() (schema.RID, error)

func (*HashIndex) Delete

func (h *HashIndex) Delete(dataVal schema.Constant, dataRID schema.RID) error

func (*HashIndex) Insert

func (h *HashIndex) Insert(dataVal schema.Constant, dataRID schema.RID) error

func (*HashIndex) Next

func (h *HashIndex) Next() (bool, error)

type Index

type Index interface {
	BeforeFirst(searchKey schema.Constant) error
	Next() (bool, error)
	DataRID() (schema.RID, error)
	Insert(dataVal schema.Constant, dataRID schema.RID) error
	Delete(dataVal schema.Constant, dataRID schema.RID) error
	Close() error
}

func NewBTreeIndex

func NewBTreeIndex(tx *transaction.Transaction, idxName string, leafLayout *record.Layout) (Index, error)

func NewHashIndex

func NewHashIndex(tx *transaction.Transaction, idxName string, layout *record.Layout) (Index, error)

type Initializer

type Initializer = func(tx *transaction.Transaction, idxName string, layout *record.Layout) (Index, error)

type JoinScan

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

func NewJoinScan

func NewJoinScan(lhs query.Scan, rhs *record.TableScan, idx Index, joinField schema.FieldName) (*JoinScan, error)

func (JoinScan) BeforeFirst

func (j JoinScan) BeforeFirst() error

func (JoinScan) Close

func (j JoinScan) Close() error

func (JoinScan) HasField

func (j JoinScan) HasField(fieldName schema.FieldName) bool

func (JoinScan) Int32

func (j JoinScan) Int32(fieldName schema.FieldName) (int32, error)

func (JoinScan) Next

func (j JoinScan) Next() (bool, error)

func (JoinScan) Str

func (j JoinScan) Str(fieldName schema.FieldName) (string, error)

func (JoinScan) Val

func (j JoinScan) Val(fieldName schema.FieldName) (schema.Constant, error)

type SearchCost

type SearchCost = func(numBlocks, rpb int) int

type SelectScan

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

func NewSelectScan

func NewSelectScan(tableScan *record.TableScan, idx Index, val schema.Constant) (*SelectScan, error)

func (SelectScan) BeforeFirst

func (s SelectScan) BeforeFirst() error

func (SelectScan) Close

func (s SelectScan) Close() error

func (SelectScan) HasField

func (s SelectScan) HasField(fieldName schema.FieldName) bool

func (SelectScan) Int32

func (s SelectScan) Int32(fieldName schema.FieldName) (int32, error)

func (SelectScan) Next

func (s SelectScan) Next() (bool, error)

func (SelectScan) Str

func (s SelectScan) Str(fieldName schema.FieldName) (string, error)

func (SelectScan) Val

func (s SelectScan) Val(fieldName schema.FieldName) (schema.Constant, error)

Jump to

Keyboard shortcuts

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