postgresql/src/include/executor
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
..
execAsync.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
execdebug.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execdesc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execExpr.h Use a hash table to speed up NOT IN(values) 2021-07-07 16:29:17 +12:00
execParallel.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execPartition.h Postpone some stuff out of ExecInitModifyTable. 2021-04-06 15:57:11 -04:00
executor.h Fix mishandling of resjunk columns in ON CONFLICT ... UPDATE tlists. 2021-05-10 11:02:29 -04:00
functions.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
hashjoin.h Revert "Fix race in Parallel Hash Join batch cleanup." 2021-03-18 01:10:55 +13:00
instrument.h Fix issues in pg_stat_wal. 2021-05-19 11:38:34 +09:00
nodeAgg.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeAppend.h Add support for asynchronous execution. 2021-03-31 18:45:00 +09:00
nodeBitmapAnd.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeBitmapHeapscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeBitmapIndexscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeBitmapOr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeCtescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeCustom.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeForeignscan.h Add support for asynchronous execution. 2021-03-31 18:45:00 +09:00
nodeFunctionscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeGather.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeGatherMerge.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeGroup.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeHash.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeHashjoin.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeIncrementalSort.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeIndexonlyscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeIndexscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeLimit.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeLockRows.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeMaterial.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeMergeAppend.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeMergejoin.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeModifyTable.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeNamedtuplestorescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeNestloop.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeProjectSet.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeRecursiveunion.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeResult.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeResultCache.h Fix missing #include in nodeResultCache.h. 2021-04-06 11:23:56 -04:00
nodeSamplescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSeqscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSetOp.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSort.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSubplan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSubqueryscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeTableFuncscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeTidrangescan.h Add TID Range Scans to support efficient scanning ranges of TIDs 2021-02-27 22:59:36 +13:00
nodeTidscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeUnique.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeValuesscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeWindowAgg.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeWorktablescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
spi.h Restore the portal-level snapshot after procedure COMMIT/ROLLBACK. 2021-05-21 14:03:59 -04:00
spi_priv.h Improve performance of repeated CALLs within plpgsql procedures. 2021-01-25 22:28:29 -05:00
tablefunc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tqueue.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tstoreReceiver.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tuptable.h Update copyright for 2021 2021-01-02 13:06:25 -05:00