|
virtual | ~VolatileTree () |
|
bool | InsertKey (const IndexKey *key, RecordId rid) override |
| Inserts the (key, rid) pair into the index. More...
|
|
bool | DeleteKey (const IndexKey *key, RecordId &rid) override |
| Deletes an arbitrary data entry with matching key if rid is invalid. More...
|
|
std::unique_ptr< Index::Iterator > | StartScan (const IndexKey *lower, bool lower_isstrict, const IndexKey *upper, bool upper_isstrict) override |
| Returns a forward-iterator for all the indexed items in the specified range defined by the arguments. More...
|
|
virtual | ~Index () |
| Index object destructor. More...
|
|
const IndexDesc * | GetIndexDesc () const |
| Returns the index descriptor of this index. More...
|
|
const Schema * | GetKeySchema () const |
| Returns the key schema of this index. More...
|
|
virtual void | BulkLoad (BulkLoadIterator &iter) |
| Loads all the (key, record id) pairs provided by the iterator iter into an empty index. More...
|
|
bool | InsertRecord (const Record &rec, const Schema *tabschema=nullptr) |
| Inserts the (key, rid) extracted from the table record into the index. More...
|
|
bool | DeleteRecord (Record &rec, const Schema *tabschema=nullptr) |
| Deletes the (key, rid) extracted from the table record from the index. More...
|
|
An in-memory tree index that is stored only in memory.
It needs to be rebuilt on every restart.
Deletes an arbitrary data entry with matching key
if rid
is invalid.
Deletes the data entry with matching (key
, rid
) pair if rid
is valid.
Returns true if the deletion succeeds. Upon successful return, update rid
to the deleted indexed item's record id. Returns false if the key
(if rid
is invalid) or (key
, rid
) pair (if rid
is valid) is not found in the index, in which case, rid should be set to invalid.
Implements taco::Index.
std::unique_ptr< Index::Iterator > taco::VolatileTree::StartScan |
( |
const IndexKey * |
lower, |
|
|
bool |
lower_isstrict, |
|
|
const IndexKey * |
upper, |
|
|
bool |
upper_isstrict |
|
) |
| |
|
overridevirtual |
Returns a forward-iterator for all the indexed items in the specified range defined by the arguments.
A non-null lower
defines the lower bound and the iterator should return the indexed items with keys that are >= (lower_isstrict
== false), or > (lower_isstrict
== true) lower
. A non-null upper
defines the upper bound, and the iterator should not return the indexed items whose keys are >= (upper_isstrict
== true), or > (upper_isstrict
= false). If lower
(and/or upper
) is null, there is no lower (upper resp.) bound for the returned indexed items, in which case, lower_isstrict
and upper_isstrict
are ignored.
lower
and upper
are allowed to have fewer keys than the index schema does, the comparison between the key of an indexed item and lower
or upper
should be done only on the prefix of lower->GetNumKeys()
or upper->GetNumKeys()
keys.
Not all combinations of arguments can be supported by the underlying index and it should throw an error if the underlying index cannot reasonably support that. Tree indexes (e.g., B-tree) should support range search and prefix searches, while hash indexes may just support equality searches.
Implements taco::Index.