- Notifications
You must be signed in to change notification settings - Fork5
Commit80558c1
committed
Generate parallel sequential scan plans in simple cases.
Add a new flag, consider_parallel, to each RelOptInfo, indicatingwhether a plan for that relation could conceivably be run inside ofa parallel worker. Right now, we're pretty conservative: for example,it might be possible to defer applying a parallel-restricted qualin a worker, and later do it in the leader, but right now we justdon't try to parallelize access to that relation. That's probablythe right decision in most cases, anyway.Using the new flag, generate parallel sequential scan plans for plainbaserels, meaning that we now have parallel sequential scan inPostgreSQL. The logic here is pretty unsophisticated right now: thecosting model probably isn't right in detail, and we can't push joinsbeneath Gather nodes, so the number of plans that can actually benefitfrom this is pretty limited right now. Lots more work is needed.Nevertheless, it seems time to enable this functionality so that allthis code can actually be tested easily by users and developers.Note that, if you wish to test this functionality, it will benecessary to set max_parallel_degree to a value greater than thedefault of 0. Once a few more loose ends have been tidied up here, wemight want to consider changing the default value of this GUC, butI'm leaving it alone for now.Along the way, fix a bug in cost_gather: the previous coding thoughtthat a Gather node's transfer overhead should be costed on the basis ofthe relation size rather than the number of tuples that actually needto be passed off to the leader.Patch by me, reviewed in earlier versions by Amit Kapila.1 parentf0661c4 commit80558c1
File tree
11 files changed
+400
-44
lines changed- src
- backend
- nodes
- optimizer
- path
- plan
- util
- utils/cache
- include
- nodes
- optimizer
- utils
11 files changed
+400
-44
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1882 | 1882 |
| |
1883 | 1883 |
| |
1884 | 1884 |
| |
| 1885 | + | |
1885 | 1886 |
| |
1886 | 1887 |
| |
1887 | 1888 |
| |
|
Lines changed: 187 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| |||
71 | 72 |
| |
72 | 73 |
| |
73 | 74 |
| |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 |
| |
75 | 79 |
| |
76 | 80 |
| |
| |||
158 | 162 |
| |
159 | 163 |
| |
160 | 164 |
| |
161 |
| - | |
| 165 | + | |
| 166 | + | |
162 | 167 |
| |
163 | 168 |
| |
164 | 169 |
| |
| |||
222 | 227 |
| |
223 | 228 |
| |
224 | 229 |
| |
| 230 | + | |
225 | 231 |
| |
226 | 232 |
| |
227 |
| - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
228 | 236 |
| |
229 | 237 |
| |
230 | 238 |
| |
| |||
234 | 242 |
| |
235 | 243 |
| |
236 | 244 |
| |
| 245 | + | |
237 | 246 |
| |
238 | 247 |
| |
239 | 248 |
| |
| |||
245 | 254 |
| |
246 | 255 |
| |
247 | 256 |
| |
248 |
| - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
249 | 270 |
| |
250 | 271 |
| |
251 | 272 |
| |
| |||
458 | 479 |
| |
459 | 480 |
| |
460 | 481 |
| |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
461 | 607 |
| |
462 | 608 |
| |
463 | 609 |
| |
| |||
466 | 612 |
| |
467 | 613 |
| |
468 | 614 |
| |
| 615 | + | |
469 | 616 |
| |
470 | 617 |
| |
471 | 618 |
| |
| |||
477 | 624 |
| |
478 | 625 |
| |
479 | 626 |
| |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
480 | 661 |
| |
481 | 662 |
| |
482 | 663 |
| |
| |||
714 | 895 |
| |
715 | 896 |
| |
716 | 897 |
| |
| 898 | + | |
| 899 | + | |
| 900 | + | |
717 | 901 |
| |
718 | 902 |
| |
719 | 903 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
334 | 334 |
| |
335 | 335 |
| |
336 | 336 |
| |
337 |
| - | |
| 337 | + | |
338 | 338 |
| |
339 | 339 |
| |
340 | 340 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
73 | 85 |
| |
74 | 86 |
| |
75 | 87 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
207 |
| - | |
| 207 | + | |
| 208 | + | |
208 | 209 |
| |
209 | 210 |
| |
210 | 211 |
| |
| |||
223 | 224 |
| |
224 | 225 |
| |
225 | 226 |
| |
226 |
| - | |
227 |
| - | |
228 |
| - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
229 | 230 |
| |
230 | 231 |
| |
231 | 232 |
| |
|
0 commit comments
Comments
(0)