pub struct InProgressSet { /* private fields */ }Expand description
Compact in-progress set. Stored as a sorted Vec<u64> so the
contains check is a binary search — O(log n) and zero
allocation per lookup. We expect n to be tens at most (the
active transaction count); for that range bsearch beats a
hashset by a wide margin on both wall-clock and cache.
When n blows past ~1k (which would mean a runaway leak — every
real OLTP workload caps at a few dozen concurrent writers) we
would consider a roaring-bitmap-style sparse representation;
not needed at v7.37.15.0 scale.
Implementations§
Source§impl InProgressSet
impl InProgressSet
Sourcepub fn from_sorted(sorted: Vec<u64>) -> InProgressSet
pub fn from_sorted(sorted: Vec<u64>) -> InProgressSet
Construct from a pre-sorted slice. The caller must verify monotonic order; debug builds assert.
Sourcepub const fn empty() -> InProgressSet
pub const fn empty() -> InProgressSet
Empty set — no transactions in flight. The default for a snapshot taken in a quiescent moment.
Sourcepub fn ids(&self) -> &[u64]
pub fn ids(&self) -> &[u64]
v7.39 (round 518) — the ids, in order. txid_current_snapshot()
renders them as PG’s xip_list.
Trait Implementations§
Source§impl Clone for InProgressSet
impl Clone for InProgressSet
Source§fn clone(&self) -> InProgressSet
fn clone(&self) -> InProgressSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more