pub struct FactorizedExpandOperator { /* private fields */ }Expand description
An expand operator that produces factorized output.
Instead of duplicating input rows for each neighbor (Cartesian product), this operator adds neighbors as a new factorization level. This avoids exponential blowup in multi-hop queries.
§Memory Comparison
For a query MATCH (a)-[:KNOWS]->(b)-[:KNOWS]->(c) with:
- 100 source nodes
- Average 10 neighbors per hop
Regular Expand (flat):
- After hop 1: 100 * 10 = 1,000 rows
- After hop 2: 1,000 * 10 = 10,000 rows
- Memory: ~10,000 * row_size
Factorized Expand:
- Level 0: 100 source nodes
- Level 1: 1,000 first-hop neighbors
- Level 2: 10,000 second-hop neighbors
- Memory: ~11,100 values (no duplication)
Implementations§
Source§impl FactorizedExpandOperator
impl FactorizedExpandOperator
Sourcepub fn new(
store: Arc<LpgStore>,
input: Box<dyn Operator>,
source_column: usize,
direction: Direction,
edge_type: Option<String>,
) -> Self
pub fn new( store: Arc<LpgStore>, input: Box<dyn Operator>, source_column: usize, direction: Direction, edge_type: Option<String>, ) -> Self
Creates a new factorized expand 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 with_column_names(self, names: Vec<String>) -> Self
pub fn with_column_names(self, names: Vec<String>) -> Self
Sets the input column names for schema tracking.
Sourcepub fn next_factorized(&mut self) -> FactorizedResult
pub fn next_factorized(&mut self) -> FactorizedResult
Gets the next factorized chunk.
This is the main method for factorized execution. For compatibility
with the regular Operator trait, use next() which flattens the result.
Trait Implementations§
Source§impl FactorizedOperator for FactorizedExpandOperator
impl FactorizedOperator for FactorizedExpandOperator
Source§fn next_factorized(&mut self) -> FactorizedResult
fn next_factorized(&mut self) -> FactorizedResult
Returns the next chunk as factorized data.
Source§impl Operator for FactorizedExpandOperator
impl Operator for FactorizedExpandOperator
Auto Trait Implementations§
impl Freeze for FactorizedExpandOperator
impl !RefUnwindSafe for FactorizedExpandOperator
impl Send for FactorizedExpandOperator
impl Sync for FactorizedExpandOperator
impl Unpin for FactorizedExpandOperator
impl !UnwindSafe for FactorizedExpandOperator
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
Mutably borrows from an owned value. Read more