Commit 9688c4e
committed
Make reduce_outer_joins() smarter about semijoins.
reduce_outer_joins() mistakenly treated a semijoin like a left join for
purposes of deciding whether not-null constraints created by the join's
quals could be passed down into the join's left-hand side (possibly
resulting in outer-join simplification there). Actually, semijoin works
like inner join for this purpose, ie, we do not need to see any rows that
can't possibly satisfy the quals. Hence, two-line fix to treat semi and
inner joins alike. Per observation by Andres Freund about a performance
gripe from Yazan Suleiman.
Back-patch to 8.4, since this oversight has been there since the current
handling of semijoins was implemented.1 parent 507069d commit 9688c4e
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1840 | 1840 | | |
1841 | 1841 | | |
1842 | 1842 | | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
1843 | 1848 | | |
1844 | 1849 | | |
1845 | 1850 | | |
| |||
1849 | 1854 | | |
1850 | 1855 | | |
1851 | 1856 | | |
1852 | | - | |
| 1857 | + | |
1853 | 1858 | | |
1854 | 1859 | | |
1855 | 1860 | | |
| |||
1869 | 1874 | | |
1870 | 1875 | | |
1871 | 1876 | | |
1872 | | - | |
| 1877 | + | |
1873 | 1878 | | |
1874 | 1879 | | |
1875 | 1880 | | |
1876 | 1881 | | |
1877 | 1882 | | |
1878 | 1883 | | |
1879 | | - | |
| 1884 | + | |
1880 | 1885 | | |
1881 | 1886 | | |
1882 | 1887 | | |
| |||
0 commit comments