Skip to content

Commit e3909e7

Browse files
committed
Improve comments
1 parent 37a5b16 commit e3909e7

File tree

1 file changed

+6
-2
lines changed
  • lib/query-plan-executor/src

1 file changed

+6
-2
lines changed

lib/query-plan-executor/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,12 @@ impl ExecutablePlanNode for ParallelNode {
519519
}
520520
}
521521
// We collect indexes in paths (replacing "@") to mutate the final result later
522-
// This is not a case for SequenceNode only for ParallelNode
523-
// Because in ParallelNode, we can't hold the mutable references
522+
// It might look similar to `FlattenNode.execute` which is called within `SequenceNode`
523+
// But it is not because in `SequenceNode`, we collect mutable references and mutate them during sequence execution.
524+
// While here, we collect the indexes in paths to get the mutable reference after the execution.
525+
// Collecting mutable references during traversal is possible in sequential execution which is more optimal than the following,
526+
// but in parallel execution, we need to collect indexes in paths to mutate the final result later.
527+
// We don't apply the following logic to the sequential execution, because the one there is more optimal.
524528
let mut indexes_in_paths: Vec<VecDeque<usize>> = vec![];
525529
traverse_and_callback(
526530
data,

0 commit comments

Comments
 (0)