Pull up ANY-SUBLINK with the necessary lateral support.
Alexander Korotkov <akorotkov@postgresql.org>
Pull up ANY-SUBLINK with the necessary lateral support. For ANY-SUBLINK, we adopted a two-stage pull-up approach to handle different types of scenarios. In the first stage, the sublink is pulled up as a subquery. Because of this, when writing this code, we did not have the ability to perform lateral joins, and therefore, we were unable to pull up Var with varlevelsup=1. Now that we have the ability to use lateral joins, we can eliminate this limitation. Author: Andy Fan <zhihui.fan1213@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Richard Guo <guofenglinux@gmail.com> Reviewed-by: Alena Rybakina <lena.ribackina@yandex.ru> Reviewed-by: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/expected/postgres_fdw.out | modified | +3 −3 |
| contrib/postgres_fdw/sql/postgres_fdw.sql | modified | +2 −2 |
| src/backend/optimizer/plan/subselect.c | modified | +13 −4 |
| src/test/regress/expected/join.out | modified | +7 −7 |
| src/test/regress/expected/subselect.out | modified | +126 −0 |
| src/test/regress/sql/join.sql | modified | +4 −4 |
| src/test/regress/sql/subselect.sql | modified | +37 −0 |