Skip to main content

Attrs

Struct Attrs 

Source
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: bool

Implementations§

Source§

impl Attrs

Source

pub(crate) fn new(rows: RecordBatch) -> Attrs

Source

pub(crate) fn parents(rows: &RecordBatch) -> Option<&[u32]>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more