diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-22 19:12:38 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-22 19:12:38 -0500 |
commit | b62f94c60386796fd88256c5b7b1e8301c345166 (patch) | |
tree | bdc238f5b1cd5d4c4b8d551f1b90e8a58b3de93f /contrib/postgres_fdw/postgres_fdw.c | |
parent | 9c58101117d25f174c8d8013befdc33c632922d0 (diff) | |
download | postgresql-b62f94c60386796fd88256c5b7b1e8301c345166.tar.gz postgresql-b62f94c60386796fd88256c5b7b1e8301c345166.zip |
Allow simplification of EXISTS() subqueries containing LIMIT.
The locution "EXISTS(SELECT ... LIMIT 1)" seems to be rather common among
people who don't realize that the database already performs optimizations
equivalent to putting LIMIT 1 in the sub-select. Unfortunately, this was
actually making things worse, because it prevented us from optimizing such
EXISTS clauses into semi or anti joins. Teach simplify_EXISTS_query() to
suppress constant-positive LIMIT clauses. That fixes the semi/anti-join
case, and may help marginally even for cases that have to be left as
sub-SELECTs.
Marti Raudsepp, reviewed by David Rowley
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions