Skip to content

Wrap more immutable plan parts into Arc #19852

@askalt

Description

@askalt

Part of #19795

As with_new_children clones the most fields of the plan, we could make clone cheaper, arcing immutable parts that may be long (projection, different expressions), the issue suggests to:

  • Store projection as Option<Arc<[usize]>> instead of Option<Vec<usize>> in FilterExec, HashJoinExec, NestedLoopJoinExec.
  • Store exprs as Arc<[ProjectionExpr]> instead of Vec in ProjectionExprs.
  • Store arced aggregation and filter expressions within AggregateExec.
  • Store arced expr, null_expr, groups in PhysicalGroupBy.

Also, to simplify implementation, we could improve project_schema and Statistics::project methods to get Option<impl AsRef<[usize]>> instead of the Option<&Vec<usize>> as Option<&Vec> always could be borrowed as deref.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions