Commit 4fcf484
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 ed8bec9 commit 4fcf484
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 | |
|---|---|---|---|
| |||
2066 | 2066 | | |
2067 | 2067 | | |
2068 | 2068 | | |
2069 | | - | |
2070 | | - | |
2071 | | - | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | 2069 | | |
2084 | 2070 | | |
2085 | 2071 | | |
| |||
4519 | 4505 | | |
4520 | 4506 | | |
4521 | 4507 | | |
4522 | | - | |
4523 | | - | |
4524 | | - | |
4525 | 4508 | | |
4526 | 4509 | | |
4527 | 4510 | | |
| |||
| 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 | | |
| |||
2860 | 2851 | | |
2861 | 2852 | | |
2862 | 2853 | | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | 2854 | | |
2867 | 2855 | | |
2868 | 2856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1847 | 1847 | | |
1848 | 1848 | | |
1849 | 1849 | | |
1850 | | - | |
1851 | 1850 | | |
1852 | 1851 | | |
1853 | 1852 | | |
| |||
1892 | 1891 | | |
1893 | 1892 | | |
1894 | 1893 | | |
| 1894 | + | |
1895 | 1895 | | |
1896 | 1896 | | |
1897 | 1897 | | |
| |||
2056 | 2056 | | |
2057 | 2057 | | |
2058 | 2058 | | |
2059 | | - | |
2060 | | - | |
2061 | | - | |
2062 | | - | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
2068 | 2059 | | |
2069 | 2060 | | |
2070 | 2061 | | |
| |||
3355 | 3346 | | |
3356 | 3347 | | |
3357 | 3348 | | |
3358 | | - | |
3359 | | - | |
3360 | | - | |
3361 | 3349 | | |
3362 | 3350 | | |
3363 | 3351 | | |
| |||
| 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