- Notifications
You must be signed in to change notification settings - Fork5
Commit6fbc323
committed
Further fallout from the MergeAppend patch.
Fix things so that top-N sorting can be used in child Sort nodes of aMergeAppend node, when there is a LIMIT and no intervening joins orgrouping. Actually doing this on the executor side isn't too bad,but it's a bit messier to get the planner to cost it properly.Per gripe from Robert Haas.In passing, fix an oversight in the original top-N-sorting patch:query_planner should not assume that a LIMIT can be used to make anexplicit sort cheaper when there will be grouping or aggregation inbetween. Possibly this should be back-patched, but I'm not sure themistake is serious enough to be a real problem in practice.1 parent45768d1 commit6fbc323
File tree
7 files changed
+103
-21
lines changed- src
- backend
- executor
- nodes
- optimizer
- plan
- util
- include/nodes
7 files changed
+103
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
311 | 321 | | |
312 | | - | |
| 322 | + | |
313 | 323 | | |
314 | 324 | | |
315 | | - | |
| 325 | + | |
316 | 326 | | |
317 | 327 | | |
318 | 328 | | |
| |||
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
327 | 350 | | |
328 | 351 | | |
329 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1493 | 1493 | | |
1494 | 1494 | | |
1495 | 1495 | | |
| 1496 | + | |
1496 | 1497 | | |
1497 | 1498 | | |
1498 | 1499 | | |
| |||
1611 | 1612 | | |
1612 | 1613 | | |
1613 | 1614 | | |
| 1615 | + | |
1614 | 1616 | | |
1615 | 1617 | | |
1616 | 1618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
| 717 | + | |
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
| |||
323 | 327 | | |
324 | 328 | | |
325 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
326 | 333 | | |
327 | 334 | | |
328 | 335 | | |
| |||
347 | 354 | | |
348 | 355 | | |
349 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
350 | 360 | | |
351 | 361 | | |
352 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
| 971 | + | |
971 | 972 | | |
972 | 973 | | |
973 | 974 | | |
| |||
1119 | 1120 | | |
1120 | 1121 | | |
1121 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1122 | 1138 | | |
1123 | 1139 | | |
1124 | 1140 | | |
1125 | 1141 | | |
1126 | 1142 | | |
1127 | 1143 | | |
1128 | | - | |
| 1144 | + | |
1129 | 1145 | | |
1130 | 1146 | | |
1131 | 1147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
697 | 726 | | |
698 | 727 | | |
699 | 728 | | |
| |||
720 | 749 | | |
721 | 750 | | |
722 | 751 | | |
723 | | - | |
| 752 | + | |
724 | 753 | | |
725 | 754 | | |
726 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
766 | 767 | | |
767 | 768 | | |
768 | 769 | | |
| 770 | + | |
769 | 771 | | |
770 | 772 | | |
771 | 773 | | |
| |||
0 commit comments
Comments
(0)