Commit dc45188
committed
Get rid of the planner's LateralJoinInfo data structure.
I originally modeled this data structure on SpecialJoinInfo, but after
commit acfcd45 that looks like a pretty poor decision.
All we really need is relid sets identifying laterally-referenced rels;
and most of the time, what we want to know about includes indirect lateral
references, a case the LateralJoinInfo data was unsuited to compute with
any efficiency. The previous commit redefined RelOptInfo.lateral_relids
as the transitive closure of lateral references, so that it easily supports
checking indirect references. For the places where we really do want just
direct references, add a new RelOptInfo field direct_lateral_relids, which
is easily set up as a copy of lateral_relids before we perform the
transitive closure calculation. Then we can just drop lateral_info_list
and LateralJoinInfo and the supporting code. This makes the planner's
handling of lateral references noticeably more efficient, and shorter too.
Such a change can't be back-patched into stable branches for fear of
breaking extensions that might be looking at the planner's data structures;
but it seems not too late to push it into 9.5, so I've done so.1 parent 12a54c8 commit dc45188
File tree
17 files changed
+100
-289
lines changed- src
- backend
- nodes
- optimizer
- path
- plan
- prep
- util
- rewrite
- include/nodes
17 files changed
+100
-289
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
2048 | | - | |
2049 | | - | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
2054 | | - | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | 2044 | | |
2059 | 2045 | | |
2060 | 2046 | | |
| |||
4479 | 4465 | | |
4480 | 4466 | | |
4481 | 4467 | | |
4482 | | - | |
4483 | | - | |
4484 | | - | |
4485 | 4468 | | |
4486 | 4469 | | |
4487 | 4470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | 848 | | |
858 | 849 | | |
859 | 850 | | |
| |||
2850 | 2841 | | |
2851 | 2842 | | |
2852 | 2843 | | |
2853 | | - | |
2854 | | - | |
2855 | | - | |
2856 | 2844 | | |
2857 | 2845 | | |
2858 | 2846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1814 | 1814 | | |
1815 | 1815 | | |
1816 | 1816 | | |
1817 | | - | |
1818 | 1817 | | |
1819 | 1818 | | |
1820 | 1819 | | |
| |||
1858 | 1857 | | |
1859 | 1858 | | |
1860 | 1859 | | |
| 1860 | + | |
1861 | 1861 | | |
1862 | 1862 | | |
1863 | 1863 | | |
| |||
2022 | 2022 | | |
2023 | 2023 | | |
2024 | 2024 | | |
2025 | | - | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | | - | |
2034 | 2025 | | |
2035 | 2026 | | |
2036 | 2027 | | |
| |||
3315 | 3306 | | |
3316 | 3307 | | |
3317 | 3308 | | |
3318 | | - | |
3319 | | - | |
3320 | | - | |
3321 | 3309 | | |
3322 | 3310 | | |
3323 | 3311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
| 562 | + | |
571 | 563 | | |
572 | 564 | | |
573 | 565 | | |
| |||
582 | 574 | | |
583 | 575 | | |
584 | 576 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
| 577 | + | |
594 | 578 | | |
595 | 579 | | |
596 | 580 | | |
| |||
922 | 906 | | |
923 | 907 | | |
924 | 908 | | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
936 | 912 | | |
937 | 913 | | |
938 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | 442 | | |
446 | 443 | | |
447 | 444 | | |
| |||
0 commit comments