- Notifications
You must be signed in to change notification settings - Fork5
Commit7aea8e4
committed
Determine whether it's safe to attempt a parallel plan for a query.
Commit924bcf4 introduced a frameworkfor parallel computation in PostgreSQL that makes most but not allbuilt-in functions safe to execute in parallel mode. In order to haveparallel query, we'll need to be able to determine whether that querycontains functions (either built-in or user-defined) that cannot besafely executed in parallel mode. This requires those functions to belabeled, so this patch introduces an infrastructure for that. Somefunctions currently labeled as safe may need to be revised depending onhow pending issues related to heavyweight locking under paralllelismare resolved.Parallel plans can't be used except for the case where the query willrun to completion. If portal execution were suspended, the parallelmode restrictions would need to remain in effect during that time, butthat might make other queries fail. Therefore, this patch introducesa framework that enables consideration of parallel plans only when itis known that the plan will be run to completion. This probably needssome refinement; for example, at bind time, we do not know whether aquery run via the extended protocol will be execution to completion orrun with a limited fetch count. Having the client indicate itsintentions at bind time would constitute a wire protocol break. Somecontexts in which parallel mode would be safe are not adjusted by thispatch; the default is not to try parallel plans except from call sitesthat have been updated to say that such plans are OK.This commit doesn't introduce any parallel paths or plans; it justprovides a way to determine whether they could potentially be used.I'm committing it on the theory that the remaining parallel sequentialscan patches will also get committed to this release, hopefully in thenot-too-distant future.Robert Haas and Amit Kapila. Reviewed (in earlier versions) by NoahMisch.1 parentb44d92b commit7aea8e4
File tree
31 files changed
+3162
-2781
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- executor
- nodes
- optimizer
- plan
- util
- parser
- tcop
- utils/cache
- bin/pg_dump
- include
- catalog
- nodes
- optimizer
- parser
- utils
- pl/plpgsql/src
31 files changed
+3162
-2781
lines changedLines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4994 | 4994 |
| |
4995 | 4995 |
| |
4996 | 4996 |
| |
| 4997 | + | |
| 4998 | + | |
| 4999 | + | |
| 5000 | + | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
| 5006 | + | |
| 5007 | + | |
| 5008 | + | |
| 5009 | + | |
| 5010 | + | |
| 5011 | + | |
| 5012 | + | |
| 5013 | + | |
4997 | 5014 |
| |
4998 | 5015 |
| |
4999 | 5016 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
194 | 206 |
| |
195 | 207 |
| |
196 | 208 |
| |
|
Lines changed: 38 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
| |||
411 | 412 |
| |
412 | 413 |
| |
413 | 414 |
| |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
414 | 452 |
| |
415 | 453 |
| |
416 | 454 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
540 | 540 |
| |
541 | 541 |
| |
542 | 542 |
| |
| 543 | + | |
543 | 544 |
| |
544 | 545 |
| |
545 | 546 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
| 86 | + | |
86 | 87 |
| |
87 | 88 |
| |
88 | 89 |
| |
| |||
344 | 345 |
| |
345 | 346 |
| |
346 | 347 |
| |
| 348 | + | |
347 | 349 |
| |
348 | 350 |
| |
349 | 351 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
348 | 348 |
| |
349 | 349 |
| |
350 | 350 |
| |
351 |
| - | |
| 351 | + | |
352 | 352 |
| |
353 | 353 |
| |
354 | 354 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
707 | 707 |
| |
708 | 708 |
| |
709 | 709 |
| |
710 |
| - | |
| 710 | + | |
711 | 711 |
| |
712 | 712 |
| |
713 | 713 |
| |
|
Lines changed: 46 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
468 |
| - | |
| 468 | + | |
| 469 | + | |
469 | 470 |
| |
470 | 471 |
| |
471 | 472 |
| |
| |||
513 | 514 |
| |
514 | 515 |
| |
515 | 516 |
| |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
516 | 524 |
| |
517 | 525 |
| |
518 | 526 |
| |
| |||
544 | 552 |
| |
545 | 553 |
| |
546 | 554 |
| |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
547 | 576 |
| |
548 | 577 |
| |
549 | 578 |
| |
| |||
592 | 621 |
| |
593 | 622 |
| |
594 | 623 |
| |
595 |
| - | |
| 624 | + | |
| 625 | + | |
596 | 626 |
| |
597 | 627 |
| |
598 | 628 |
| |
| |||
606 | 636 |
| |
607 | 637 |
| |
608 | 638 |
| |
| 639 | + | |
609 | 640 |
| |
610 | 641 |
| |
611 | 642 |
| |
| |||
650 | 681 |
| |
651 | 682 |
| |
652 | 683 |
| |
653 |
| - | |
| 684 | + | |
| 685 | + | |
654 | 686 |
| |
655 | 687 |
| |
656 | 688 |
| |
| |||
712 | 744 |
| |
713 | 745 |
| |
714 | 746 |
| |
| 747 | + | |
| 748 | + | |
715 | 749 |
| |
716 | 750 |
| |
717 | 751 |
| |
| |||
858 | 892 |
| |
859 | 893 |
| |
860 | 894 |
| |
| 895 | + | |
861 | 896 |
| |
862 | 897 |
| |
863 | 898 |
| |
| |||
878 | 913 |
| |
879 | 914 |
| |
880 | 915 |
| |
| 916 | + | |
881 | 917 |
| |
882 | 918 |
| |
883 | 919 |
| |
884 | 920 |
| |
885 | 921 |
| |
886 | 922 |
| |
887 |
| - | |
| 923 | + | |
888 | 924 |
| |
889 | 925 |
| |
890 | 926 |
| |
| |||
1061 | 1097 |
| |
1062 | 1098 |
| |
1063 | 1099 |
| |
| 1100 | + | |
1064 | 1101 |
| |
1065 | 1102 |
| |
1066 | 1103 |
| |
| |||
1141 | 1178 |
| |
1142 | 1179 |
| |
1143 | 1180 |
| |
| 1181 | + | |
1144 | 1182 |
| |
1145 | 1183 |
| |
1146 | 1184 |
| |
| |||
1178 | 1216 |
| |
1179 | 1217 |
| |
1180 | 1218 |
| |
1181 |
| - | |
| 1219 | + | |
| 1220 | + | |
1182 | 1221 |
| |
1183 | 1222 |
| |
1184 | 1223 |
| |
| |||
1250 | 1289 |
| |
1251 | 1290 |
| |
1252 | 1291 |
| |
| 1292 | + | |
| 1293 | + | |
1253 | 1294 |
| |
1254 | 1295 |
| |
1255 | 1296 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
138 | 139 |
| |
139 | 140 |
| |
140 | 141 |
| |
| |||
174 | 175 |
| |
175 | 176 |
| |
176 | 177 |
| |
| 178 | + | |
177 | 179 |
| |
178 | 180 |
| |
179 | 181 |
| |
| |||
216 | 218 |
| |
217 | 219 |
| |
218 | 220 |
| |
| 221 | + | |
219 | 222 |
| |
220 | 223 |
| |
221 | 224 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1611 | 1611 |
| |
1612 | 1612 |
| |
1613 | 1613 |
| |
| 1614 | + | |
1614 | 1615 |
| |
1615 | 1616 |
| |
1616 | 1617 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
243 | 243 |
| |
244 | 244 |
| |
245 | 245 |
| |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
246 | 251 |
| |
247 | 252 |
| |
248 | 253 |
| |
| |||
474 | 479 |
| |
475 | 480 |
| |
476 | 481 |
| |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
477 | 487 |
| |
478 | 488 |
| |
479 | 489 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
496 | 496 |
| |
497 | 497 |
| |
498 | 498 |
| |
499 |
| - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
500 | 502 |
| |
501 | 503 |
| |
502 | 504 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
| 97 | + | |
97 | 98 |
| |
98 | 99 |
| |
99 | 100 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
256 | 256 |
| |
257 | 257 |
| |
258 | 258 |
| |
| 259 | + | |
259 | 260 |
| |
260 | 261 |
| |
261 | 262 |
| |
| |||
1787 | 1788 |
| |
1788 | 1789 |
| |
1789 | 1790 |
| |
| 1791 | + | |
| 1792 | + | |
1790 | 1793 |
| |
1791 | 1794 |
| |
1792 | 1795 |
| |
|
0 commit comments
Comments
(0)