forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2f17b57
committed
Improve performance of adjust_appendrel_attrs_multilevel.
The present implementations of adjust_appendrel_attrs_multilevel andits sibling adjust_child_relids_multilevel are very messy, becausethey work by reconstructing the relids of the child's immediateparent and then seeing if that's bms_equal to the relids of thetarget parent. Aside from being quite inefficient, this will notwork with planned future changes to make joinrels' relid setscontain outer-join relids in addition to baserels.The whole thing can be solved at a stroke by adding explicit parentand top_parent links to child RelOptInfos, and making these functionswork with RelOptInfo pointers instead of relids. Doing that issimpler for most callers, too.In my original version of this patch, I got rid ofRelOptInfo.top_parent_relids on the grounds that it was now redundant.However, that adds a lot of code churn in places that otherwise wouldnot need changing, and arguably the extra indirection needed to fetchtop_parent->relids in those places costs something. So this versionleaves that field in place.Discussion:https://postgr.es/m/553080.1657481916@sss.pgh.pa.us1 parentec97db3 commit2f17b57
File tree
8 files changed
+83
-94
lines changed- src
- backend
- optimizer
- path
- plan
- util
- partitioning
- include
- nodes
- optimizer
8 files changed
+83
-94
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
1763 | | - | |
1764 | | - | |
| 1763 | + | |
| 1764 | + | |
1765 | 1765 | | |
1766 | 1766 | | |
1767 | 1767 | | |
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
2629 | | - | |
2630 | | - | |
| 2629 | + | |
| 2630 | + | |
2631 | 2631 | | |
2632 | 2632 | | |
2633 | 2633 | | |
| |||
2768 | 2768 | | |
2769 | 2769 | | |
2770 | 2770 | | |
2771 | | - | |
2772 | | - | |
| 2771 | + | |
| 2772 | + | |
2773 | 2773 | | |
2774 | 2774 | | |
2775 | 2775 | | |
| |||
2791 | 2791 | | |
2792 | 2792 | | |
2793 | 2793 | | |
2794 | | - | |
2795 | | - | |
| 2794 | + | |
| 2795 | + | |
2796 | 2796 | | |
2797 | 2797 | | |
2798 | 2798 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1793 | 1793 | | |
1794 | 1794 | | |
1795 | 1795 | | |
1796 | | - | |
1797 | | - | |
| 1796 | + | |
| 1797 | + | |
1798 | 1798 | | |
1799 | 1799 | | |
1800 | 1800 | | |
| |||
1806 | 1806 | | |
1807 | 1807 | | |
1808 | 1808 | | |
1809 | | - | |
1810 | | - | |
| 1809 | + | |
| 1810 | + | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | 1813 | | |
| |||
1828 | 1828 | | |
1829 | 1829 | | |
1830 | 1830 | | |
1831 | | - | |
1832 | | - | |
| 1831 | + | |
| 1832 | + | |
1833 | 1833 | | |
1834 | 1834 | | |
1835 | 1835 | | |
1836 | | - | |
1837 | | - | |
| 1836 | + | |
| 1837 | + | |
1838 | 1838 | | |
1839 | 1839 | | |
1840 | 1840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
| 482 | + | |
483 | 483 | | |
484 | | - | |
485 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
490 | | - | |
| 490 | + | |
| 491 | + | |
491 | 492 | | |
492 | 493 | | |
493 | | - | |
494 | 494 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | 495 | | |
501 | | - | |
502 | | - | |
| 496 | + | |
| 497 | + | |
503 | 498 | | |
504 | | - | |
505 | | - | |
506 | | - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
507 | 505 | | |
508 | 506 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
| 507 | + | |
| 508 | + | |
513 | 509 | | |
514 | | - | |
515 | 510 | | |
516 | 511 | | |
517 | 512 | | |
| |||
554 | 549 | | |
555 | 550 | | |
556 | 551 | | |
557 | | - | |
558 | | - | |
559 | | - | |
| 552 | + | |
| 553 | + | |
560 | 554 | | |
561 | 555 | | |
562 | 556 | | |
563 | | - | |
| 557 | + | |
| 558 | + | |
564 | 559 | | |
565 | 560 | | |
566 | 561 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | 562 | | |
572 | 563 | | |
573 | | - | |
574 | | - | |
| 564 | + | |
| 565 | + | |
575 | 566 | | |
576 | | - | |
| 567 | + | |
577 | 568 | | |
578 | 569 | | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | 570 | | |
590 | | - | |
| 571 | + | |
591 | 572 | | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
596 | 579 | | |
597 | 580 | | |
598 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
599 | 585 | | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | 586 | | |
605 | 587 | | |
606 | | - | |
| 588 | + | |
607 | 589 | | |
608 | 590 | | |
609 | 591 | | |
| |||
694 | 676 | | |
695 | 677 | | |
696 | 678 | | |
697 | | - | |
698 | | - | |
| 679 | + | |
| 680 | + | |
699 | 681 | | |
700 | 682 | | |
701 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4026 | 4026 | | |
4027 | 4027 | | |
4028 | 4028 | | |
4029 | | - | |
4030 | | - | |
| 4029 | + | |
| 4030 | + | |
4031 | 4031 | | |
4032 | 4032 | | |
4033 | 4033 | | |
| |||
4244 | 4244 | | |
4245 | 4245 | | |
4246 | 4246 | | |
4247 | | - | |
4248 | | - | |
| 4247 | + | |
| 4248 | + | |
4249 | 4249 | | |
4250 | 4250 | | |
4251 | 4251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
276 | 272 | | |
277 | 273 | | |
278 | 274 | | |
| |||
294 | 290 | | |
295 | 291 | | |
296 | 292 | | |
| 293 | + | |
| 294 | + | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
| |||
663 | 661 | | |
664 | 662 | | |
665 | 663 | | |
| 664 | + | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| |||
855 | 857 | | |
856 | 858 | | |
857 | 859 | | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | 860 | | |
862 | 861 | | |
863 | 862 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
533 | | - | |
| 532 | + | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
942 | 950 | | |
943 | 951 | | |
944 | 952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments
Comments
(0)