postgresql/src/backend
David Rowley 29f45e299e Use a hash table to speed up NOT IN(values)
Similar to 50e17ad28, which allowed hash tables to be used for IN clauses
with a set of constants, here we add the same feature for NOT IN clauses.

NOT IN evaluates the same as: WHERE a <> v1 AND a <> v2 AND a <> v3.
Obviously, if we're using a hash table we must be exactly equivalent to
that and return the same result taking into account that either side of
the condition could contain a NULL.  This requires a little bit of
special handling to make work with the hash table version.

When processing NOT IN, the ScalarArrayOpExpr's operator will be the <>
operator.  To be able to build and lookup a hash table we must use the
<>'s negator operator.  The planner checks if that exists and is hashable
and sets the relevant fields in ScalarArrayOpExpr to instruct the executor
to use hashing.

Author: David Rowley, James Coleman
Reviewed-by: James Coleman, Zhihong Yu
Discussion: https://postgr.es/m/CAApHDvoF1mum_FRk6D621edcB6KSHBi2+GAgWmioj5AhOu2vwQ@mail.gmail.com
2021-07-07 16:29:17 +12:00
..
access Use WaitLatch() instead of pg_usleep() at the end of backups 2021-07-06 08:10:59 +09:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog genbki stricter error handling 2021-06-30 08:50:26 +02:00
commands Refactor function parse_subscription_options. 2021-07-06 07:46:50 +05:30
executor Use a hash table to speed up NOT IN(values) 2021-07-07 16:29:17 +12:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Prepare for forthcoming LLVM 13 API change. 2021-06-25 11:28:20 +12:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Refactor SASL code with a generic interface for its mechanisms 2021-07-07 10:55:15 +09:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Use a hash table to speed up NOT IN(values) 2021-07-07 16:29:17 +12:00
optimizer Use a hash table to speed up NOT IN(values) 2021-07-07 16:29:17 +12:00
parser Use a hash table to speed up NOT IN(values) 2021-07-07 16:29:17 +12:00
partitioning Use a hash table to speed up NOT IN(values) 2021-07-07 16:29:17 +12:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
postmaster Message style improvements 2021-06-28 08:36:44 +02:00
regex Fix performance issue in new regex match-all detection code. 2021-05-03 11:42:31 -04:00
replication Don't try to print data type names in slot_store_error_callback(). 2021-07-02 16:04:54 -04:00
rewrite Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Error message refactoring 2021-06-27 09:41:16 +02:00
storage Remove some dead stores. 2021-07-02 13:32:21 +12:00
tcop Message style improvements 2021-06-28 08:36:44 +02:00
tsearch Improve various places that double the size of a buffer 2021-07-01 15:29:06 +12:00
utils Reduce overhead of cache-clobber testing in LookupOpclassInfo(). 2021-07-05 16:51:57 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00