Documentation ¶
Overview ¶
A generalized search tree (GiST) implementation with some modifications from the original algorithm. This implementation is based around a Fixed-Sized Page allocation, and a split algorithm with strong page-limitations.
Unlike other GiST implementations, this one is designed to be a Table rather than just an Index.
The GiST paper: http://db.cs.berkeley.edu/papers/vldb95-gist.pdf
Index ¶
- Constants
- Variables
- type Element
- type Elements
- type IBase
- type ReadAlloc
- func (r *ReadAlloc) HeadAlloc() (int64, error)
- func (r *ReadAlloc) HeadFree(id int64) error
- func (r *ReadAlloc) HeadRead(id int64) (b bufferex.Binary, e error)
- func (r *ReadAlloc) HeadWrite(id int64, b []byte) error
- func (r *ReadAlloc) Page() int
- func (r *ReadAlloc) PageAlloc() (int64, error)
- func (r *ReadAlloc) PageFree(id int64) error
- func (r *ReadAlloc) PageRead(id int64) (b bufferex.Binary, e error)
- func (r *ReadAlloc) PageWrite(id int64, b []byte) error
- type Root
- type Tree
- func (t *Tree) Delete(ctx context.Context, obj int64, q interface{}, chk func([]byte) bool) (r_abort, r_err error)
- func (t *Tree) GSearch(ctx context.Context, obj int64, q interface{}, consume func(b []byte) bool) error
- func (t *Tree) Insert(obj int64, nitem []byte) error
- func (t *Tree) NewRoot() (int64, error)
- func (t *Tree) Search(ctx context.Context, obj int64, q interface{}, consumer func([]byte)) error
- type TreeOps
- type WriteAlloc
- func (r *WriteAlloc) HeadAlloc() (int64, error)
- func (r *WriteAlloc) HeadFree(id int64) error
- func (r *WriteAlloc) HeadWrite(id int64, b []byte) error
- func (r *WriteAlloc) PageAlloc() (int64, error)
- func (r *WriteAlloc) PageFree(id int64) error
- func (r *WriteAlloc) PageWrite(id int64, b []byte) error
Constants ¶
View Source
const HeadSize = 16
Variables ¶
View Source
var EReadOnly = errors.New("EReadOnly")
View Source
var EShort = errors.New("Too short")
Functions ¶
This section is empty.
Types ¶
type TreeOps ¶
type TreeOps interface { Consistent(p []byte, q interface{}) bool Union(P Elements) []byte Penalty(E1, E2 []byte) float64 // The FirstSplit functions covers three cases. // Given FirstSplit(P,maxsize) -> A,B // // - Case 1: P is small enough to fit in maxsize. // In this case, return P,nil // - Case 2: P is small enough so that A and B can fit in maxsize each. // In this case, split P into A and B evenly. // - Case 3: P is so large, that eighter only A or B can fit in maxsize. // In this case, return A,B so that A fits in maxsize. // // Given FirstSplit(P,maxsize) -> A,B and .Sort() is implemented // P is sorted and A and B are assumed to be sorted. FirstSplit(P Elements, maxsize int) (Elements, Elements) Sort(E Elements) }
type WriteAlloc ¶
func (*WriteAlloc) HeadAlloc ¶
func (r *WriteAlloc) HeadAlloc() (int64, error)
func (*WriteAlloc) HeadFree ¶
func (r *WriteAlloc) HeadFree(id int64) error
func (*WriteAlloc) PageAlloc ¶
func (r *WriteAlloc) PageAlloc() (int64, error)
func (*WriteAlloc) PageFree ¶
func (r *WriteAlloc) PageFree(id int64) error
Click to show internal directories.
Click to hide internal directories.