pub(crate) struct Attrs {
pub(crate) rows: RecordBatch,
ordered: bool,
}Expand description
An attribute table, plus the one fact about it that makes rendering a row
cheap: whether parent_id ascends.
Every builder with the crate::schema::ATTRS shape appends one parent’s
attributes in one go, parents in ascending order, so a parent’s rows are a
contiguous run and two binary searches find it. emit_attrs used to scan
the whole table per emitted row per level — on a 330 K-row logs block that
is 66 million comparisons to render a hundred records, and it measured as
most of an unfiltered limit 100, more than the scan and more than the
paging docs/architecture.md section 11 attributes it to. Same shape
Block::emit_children already fixed for the child tables; this is the
other half of it.
Checked at open rather than assumed, because a binary search over unsorted parents does not fail — it silently drops attributes, which is the one outcome nobody would notice.
crate::series reads the same shape off its own tables and so uses this
rather than a second copy of the search.
Fields§
§rows: RecordBatch§ordered: boolImplementations§
Source§impl Attrs
impl Attrs
pub(crate) fn new(rows: RecordBatch) -> Attrs
pub(crate) fn parents(rows: &RecordBatch) -> Option<&[u32]>
Sourcepub(crate) fn run(&self, parents: &[u32], parent: u32) -> Range<usize>
pub(crate) fn run(&self, parents: &[u32], parent: u32) -> Range<usize>
The rows belonging to parent, as a range the caller still filters —
exact when the table is ordered, the whole table when it is not.
Takes the column the caller already downcast rather than repeating it, since this runs once per emitted row per level.
ponytail: that fallback is the linear scan this replaced, kept for a table no builder in this tree produces. It is O(rows) per emitted row; if one ever turns up, the fix is to sort it once at open rather than to make this cleverer.
Auto Trait Implementations§
impl !RefUnwindSafe for Attrs
impl !UnwindSafe for Attrs
impl Freeze for Attrs
impl Send for Attrs
impl Sync for Attrs
impl Unpin for Attrs
impl UnsafeUnpin for Attrs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].