forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7e0ade0
committed
Allow Gather Merge in more cases for parallel DISTINCT
Here we adjust the partial path generation for parallel DISTINCT queriesto add Sort nodes on top of any unsorted partial distinct paths.This increases the likelihood of the planner pushing a Sort below a GatherMerge which enables the final phase of the parallel distinct to beimplemented using a Unique node in more cases.Sorting the partial distinct paths is particularly useful when theDISTINCT query has an ORDER BY and LIMIT clause as this can allow cheaperplans by having the workers Hash Aggregate then Sort before feeding theresults into the Gather Merge. The non-parallel portion of the plan thenbecomes very cheap as it leaves only Unique and Limit to do in the leaderprocess.Author: Richard GuoReviewed-by: David RowleyDiscussion:https://postgr.es/m/CAMbWs48u9VoVOouJsys1qOaC9WVGVmBa+wT1dx8KvxF5GPzezA@mail.gmail.com1 parent0b6517a commit7e0ade0
File tree
2 files changed
+5
-5
lines changed- src
- backend/optimizer/plan
- test/regress/expected
2 files changed
+5
-5
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4819 | 4819 |
| |
4820 | 4820 |
| |
4821 | 4821 |
| |
4822 |
| - | |
| 4822 | + | |
4823 | 4823 |
| |
4824 | 4824 |
| |
4825 | 4825 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
235 | 235 |
| |
236 | 236 |
| |
237 | 237 |
| |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
|
0 commit comments
Comments
(0)