Re: NOT IN subquery optimization

Finnerty, Jim <jfinnert@amazon.com>

From: Jim Finnerty <jfinnert@amazon.com>
To: pgsql-hackers@postgresql.org
Date: 2019-02-21T03:27:47Z
Lists: pgsql-hackers
We can always correctly transform a NOT IN to a correlated NOT EXISTS.  In
almost all cases it is more efficient to do so.  In the one case that we've
found that is slower it does come down to a more general costing issue, so
that's probably the right way to think about it.



-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html


Commits

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