Do not resort inputs to UnionExec if they are already sorted#4946
Do not resort inputs to UnionExec if they are already sorted#4946alamb merged 2 commits intoapache:masterfrom
UnionExec if they are already sorted#4946Conversation
|
Draft as it still has a bunch of debugging that I need to remove |
| } | ||
|
|
||
| fn maintains_input_order(&self) -> bool { | ||
| let first_input_ordering = self.inputs[0].output_ordering(); |
There was a problem hiding this comment.
This is basically exactly what was suggested by @mustafasrepo with a slightly modified comment
UnionExec if they are already sorted
|
LGTM!. |
|
Benchmark runs are scheduled for baseline = 84ba3c2 and contender = 279440b. 279440b is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #4943
Rationale for this change
See #4943 -- basically the issue is that
EnforceSortingpass is adding an unecessary sort toUnionExecat some timesWhat changes are included in this PR?
UnionExec::maintains_input_orderas suggested by @mustafasrepoEnforceSortingresorts the inout of UnionExec unnecessarily #4943 (comment)Are these changes tested?
Yes
Are there any user-facing changes?
Bug fix (though I don't know if any SQL queries would be affected by this)