pub struct VisibilityMap { /* private fields */ }Expand description
Per-page visibility tracking bitmap. Pages are indexed by a
dense u32 — sparse table sizes can overshoot the bitmap and
trigger lazy resize via ensure_capacity.
Implementations§
Source§impl VisibilityMap
impl VisibilityMap
Sourcepub fn new() -> VisibilityMap
pub fn new() -> VisibilityMap
Create an empty visibility map. Initial capacity is
minimal; pages get added as mark_all_visible extends
the bitmap.
Sourcepub fn with_capacity(pages: u32) -> VisibilityMap
pub fn with_capacity(pages: u32) -> VisibilityMap
Pre-allocate room for pages pages. Useful when the
caller knows the table size up-front (e.g. ANALYZE
freshly imported data).
Sourcepub fn is_all_visible(&self, page: u32) -> bool
pub fn is_all_visible(&self, page: u32) -> bool
Returns true when page is marked all-visible. Page
indexes beyond the current bitmap return false (treated
as “unknown / not-visible”).
Sourcepub fn mark_all_visible(&self, page: u32)
pub fn mark_all_visible(&self, page: u32)
Mark page as all-visible. Extends the bitmap on demand.
Idempotent — calling twice has the same effect as calling
once.
Sourcepub fn clear_all_visible(&self, page: u32)
pub fn clear_all_visible(&self, page: u32)
Clear the all-visible bit for page. Called by every
write path that touches the page (insert / update /
delete). Cheap no-op when the page wasn’t marked or
doesn’t exist in the bitmap yet.
Sourcepub fn all_visible_count(&self) -> u64
pub fn all_visible_count(&self) -> u64
Number of all-visible pages currently tracked.
Sourcepub fn capacity_pages(&self) -> u64
pub fn capacity_pages(&self) -> u64
Total number of pages the bitmap can address (capacity, not “set count”). Mostly useful for diagnostics and memory accounting.
Sourcepub fn clear(&self)
pub fn clear(&self)
Reset the entire bitmap to “not all-visible”. Used by crash recovery and DROP TABLE.
Sourcepub fn mark_range_visible(&self, start: u32, end: u32)
pub fn mark_range_visible(&self, start: u32, end: u32)
Bulk-mark a contiguous range of pages [start, end)
as all-visible. Used by VACUUM after a successful sweep
of a page range.
Trait Implementations§
Source§impl Default for VisibilityMap
impl Default for VisibilityMap
Source§fn default() -> VisibilityMap
fn default() -> VisibilityMap
Auto Trait Implementations§
impl !Freeze for VisibilityMap
impl RefUnwindSafe for VisibilityMap
impl Send for VisibilityMap
impl Sync for VisibilityMap
impl Unpin for VisibilityMap
impl UnsafeUnpin for VisibilityMap
impl UnwindSafe for VisibilityMap
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request