pub struct IndexStorage {
pub columns: Vec<(String, SortDirection)>,
pub tree: BTreeMap<IndexKey, Vec<IndexEntry>>,
}Expand description
Storage for one declared index: BTreeMap keyed by IndexKey (direction-
wrapped per column) to a Vec of posting entries with MVCC visibility.
Fields§
§columns: Vec<(String, SortDirection)>§tree: BTreeMap<IndexKey, Vec<IndexEntry>>Non-unique keys map to Vec
Implementations§
Source§impl IndexStorage
impl IndexStorage
pub fn new(columns: Vec<(String, SortDirection)>) -> Self
Sourcepub fn total_entries(&self) -> u64
pub fn total_entries(&self) -> u64
Number of live (non-tombstoned) postings, useful for leak detection.
Sourcepub fn total_entries_including_tombstones(&self) -> u64
pub fn total_entries_including_tombstones(&self) -> u64
Total postings including tombstones (for DROP TABLE leak detection).
Sourcepub fn insert_posting(&mut self, key: IndexKey, entry: IndexEntry)
pub fn insert_posting(&mut self, key: IndexKey, entry: IndexEntry)
Insert a posting at the given key, placing it in row_id-ascending order.
Sourcepub fn tombstone_posting(
&mut self,
key: &IndexKey,
row_id: RowId,
deleted_tx: TxId,
)
pub fn tombstone_posting( &mut self, key: &IndexKey, row_id: RowId, deleted_tx: TxId, )
Stamp deleted_tx on the posting matching row_id at key.
Trait Implementations§
Source§impl Debug for IndexStorage
impl Debug for IndexStorage
Source§impl Default for IndexStorage
impl Default for IndexStorage
Source§fn default() -> IndexStorage
fn default() -> IndexStorage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IndexStorage
impl RefUnwindSafe for IndexStorage
impl Send for IndexStorage
impl Sync for IndexStorage
impl Unpin for IndexStorage
impl UnsafeUnpin for IndexStorage
impl UnwindSafe for IndexStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more