Optimize grouping equality checks with virtual slots
authorDavid Rowley <drowley@postgresql.org>
Thu, 19 Dec 2024 00:57:21 +0000 (13:57 +1300)
committerDavid Rowley <drowley@postgresql.org>
Thu, 19 Dec 2024 00:57:21 +0000 (13:57 +1300)
commit08cdb079d4a8a82c687321e9ffe0a3d3fbcc0551
tree4ac067fc248f5b098723a14386f233716361f508
parent8f4ee962691ed36302be3333c65422ed9e082743
Optimize grouping equality checks with virtual slots

8f4ee9626 fixed an old Assert failure that could happen when the slot
type used to look up the hash table for BuildTupleHashTableExt() users
wasn't a TTSOpsMinimalTuple slot.  The fix for that in the back branches
had to be to pass the TupleTableSlotOps as NULL, however in master,
since we have the inputOps parameter as was added by d96d1d515, we can
pass that down instead.

At least one caller uses a fixed slot that's always TTSOpsVirtual, so
passing down inputOps for these cases allows ExecBuildGroupingEqual() to
skip adding the EEOP_INNER_FETCHSOME ExprEvalStep.

This should increase the performance of hashed subplans very slightly.

Author: Tom Lane, David Rowley
Discussion: https://postgr.es/m/2543667.1734483723@sss.pgh.pa.us
src/backend/executor/execGrouping.c