pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check we don't misoptimize a NOT IN where the subquery returns n
Date: Fri, 01 Mar 2019 22:57:27 +0000
Message-ID: <E1gzr5r-00085f-1h@gemulon.postgresql.org> (raw)

Check we don't misoptimize a NOT IN where the subquery returns no rows.

Future-proofing against a common mistake in attempts to optimize NOT IN.
We don't have such an optimization right now, but attempts to do so
are in the works, and some of 'em are buggy.  Add a regression test case
covering the point.

David Rowley

Discussion: https://postgr.es/m/CAKJS1f90E9agVZryVyUpbHQbjTt5ExqS2Fsodmt5_A7E_cEyVA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3396138a6de329fa7b5e0dda79219b4ae82622dc

Modified Files
--------------
src/test/regress/expected/subselect.out | 13 +++++++++++++
src/test/regress/sql/subselect.sql      |  9 +++++++++
2 files changed, 22 insertions(+)



Message-ID: <E1gzr5r-00085f-1h@gemulon.postgresql.org>
Permalink:  ../E1gzr5r-00085f-1h@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gzr5r-00085f-1h@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Check we don't misoptimize a NOT IN where the subquery returns n
  In-Reply-To: <E1gzr5r-00085f-1h@gemulon.postgresql.org>
  References: <E1gzr5r-00085f-1h@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox