Commit 5601c4f
committed
add fast-path for
This patch aims to implement a fast-path for the ExecutionPlan::with_new_children function
for some plans, moving closer to a physical plan re-use implementation and improving planning
performance. If the passed children properties are the same as in self, we do not actually
recompute self's properties (which could be costly if projection mapping is required).
Instead, we just replace the children and re-use self's properties as-is.
To be able to compare two different properties -- ExecutionPlan::properties(...) signature
is modified and now returns `&Arc<PlanProperties>`. If `children` properties are the same
in `with_new_children` -- we clone our properties arc and then a parent plan will consider
our properties as unchanged, doing the same.
Also, there are other improvenets, all changes:
- Return `&Arc<PlanProperties>` from `ExecutionPlan::properties(...)` instead of a reference.
- Implement `with_new_children` fast-path if there is no children properties changes for plans:
* SortExec
* RepartitionExec
* ProjectionExec
* FilterExec
* CoalescePartitionsExec
* AggregateExec
- Export `reset_plan_states` function.
- Store `Arc<[usize]>` instead of vector within `FilterExec`.
- Store `Arc<[Arc<AggregateFunctionExpr>]>` instead of vec for aggr expr and filters.
- Store `Arc<[ProjectionExpr]> instead of vec in `ProjectionExprs` struct.
Note: currently, `reset_plan_states` does not allow to re-use plan in general: it is not
supported for dynamic filters and recursive queries features, as in this case state reset
should update pointers in the children plans.with_new_children
1 parent 4c67d02 commit 5601c4f
72 files changed
Lines changed: 719 additions & 409 deletions
File tree
- datafusion-examples/examples
- custom_data_source
- execution_monitoring
- proto
- relation_planner
- datafusion
- catalog-listing/src
- catalog/src/memory
- common/src
- utils
- core
- src
- datasource
- tests
- custom_sources_cases
- fuzz_cases
- physical_optimizer
- filter_pushdown
- user_defined
- datasource/src
- ffi/src
- tests
- physical-expr/src
- equivalence/properties
- physical-optimizer/src
- physical-plan
- benches
- src
- aggregates
- joins
- hash_join
- piecewise_merge_join
- sort_merge_join
- repartition
- sorts
- test
- windows
- proto
- src/physical_plan
- tests/cases
- docs/source/library-user-guide
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
| 552 | + | |
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
1066 | 1066 | | |
1067 | 1067 | | |
1068 | 1068 | | |
1069 | | - | |
1070 | | - | |
| 1069 | + | |
1071 | 1070 | | |
1072 | 1071 | | |
1073 | 1072 | | |
1074 | 1073 | | |
1075 | 1074 | | |
1076 | | - | |
1077 | | - | |
| 1075 | + | |
| 1076 | + | |
1078 | 1077 | | |
1079 | 1078 | | |
1080 | 1079 | | |
1081 | 1080 | | |
1082 | 1081 | | |
1083 | | - | |
1084 | | - | |
| 1082 | + | |
| 1083 | + | |
1085 | 1084 | | |
1086 | 1085 | | |
1087 | 1086 | | |
1088 | 1087 | | |
1089 | 1088 | | |
1090 | | - | |
1091 | | - | |
| 1089 | + | |
| 1090 | + | |
1092 | 1091 | | |
1093 | 1092 | | |
1094 | 1093 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3661 | 3661 | | |
3662 | 3662 | | |
3663 | 3663 | | |
3664 | | - | |
| 3664 | + | |
3665 | 3665 | | |
3666 | 3666 | | |
3667 | 3667 | | |
3668 | 3668 | | |
3669 | 3669 | | |
3670 | | - | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
3671 | 3673 | | |
3672 | 3674 | | |
3673 | 3675 | | |
| |||
3705 | 3707 | | |
3706 | 3708 | | |
3707 | 3709 | | |
3708 | | - | |
| 3710 | + | |
3709 | 3711 | | |
3710 | 3712 | | |
3711 | 3713 | | |
| |||
3859 | 3861 | | |
3860 | 3862 | | |
3861 | 3863 | | |
3862 | | - | |
| 3864 | + | |
3863 | 3865 | | |
3864 | 3866 | | |
3865 | 3867 | | |
| |||
3908 | 3910 | | |
3909 | 3911 | | |
3910 | 3912 | | |
3911 | | - | |
| 3913 | + | |
3912 | 3914 | | |
3913 | 3915 | | |
3914 | 3916 | | |
| |||
4029 | 4031 | | |
4030 | 4032 | | |
4031 | 4033 | | |
4032 | | - | |
| 4034 | + | |
4033 | 4035 | | |
4034 | 4036 | | |
4035 | 4037 | | |
| |||
0 commit comments