Skip to content

Commit 08cdb07

Browse files
committed
Optimize grouping equality checks with virtual slots
8f4ee96 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 d96d1d5, 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
1 parent 8f4ee96 commit 08cdb07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/executor/execGrouping.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ BuildTupleHashTableExt(PlanState *parent,
237237

238238
/* build comparator for all columns */
239239
hashtable->tab_eq_func = ExecBuildGroupingEqual(inputDesc, inputDesc,
240-
NULL, &TTSOpsMinimalTuple,
240+
inputOps,
241+
&TTSOpsMinimalTuple,
241242
numCols,
242243
keyColIdx, eqfuncoids, collations,
243244
allow_jit ? parent : NULL);

0 commit comments

Comments
 (0)