pub struct LazyFactorizedChainOperator { /* private fields */ }Expand description
A lazy operator that executes a factorized expand chain when next() is called.
Unlike FactorizedExpandChain which executes immediately during construction,
this operator defers execution until query runtime. This is critical for
correctness when filters are applied above the expand chain.
§Factorized Aggregation Support
This operator supports returning factorized results via next_factorized().
When the downstream operator can handle factorized data (e.g., factorized
aggregation), this avoids flattening and provides massive speedups.
Implementations§
Source§impl LazyFactorizedChainOperator
impl LazyFactorizedChainOperator
Sourcepub fn new(
store: Arc<LpgStore>,
source: Box<dyn Operator>,
steps: Vec<ExpandStep>,
) -> Self
pub fn new( store: Arc<LpgStore>, source: Box<dyn Operator>, steps: Vec<ExpandStep>, ) -> Self
Creates a new lazy factorized chain operator.
Sourcepub fn with_tx_context(self, epoch: EpochId, tx_id: Option<TxId>) -> Self
pub fn with_tx_context(self, epoch: EpochId, tx_id: Option<TxId>) -> Self
Sets the transaction context for MVCC visibility.
Sourcepub fn next_factorized(&mut self) -> FactorizedResult
pub fn next_factorized(&mut self) -> FactorizedResult
Returns the factorized result without flattening.
Use this when the next operator can handle factorized data (e.g., factorized aggregation). This is the key to 10-100x speedups for aggregate queries on multi-hop traversals.
§Returns
The factorized chunk, or None if exhausted or no results.