PostgreSQL Source Code  git master
execGrouping.c File Reference
#include "postgres.h"
#include "access/parallel.h"
#include "executor/executor.h"
#include "miscadmin.h"
#include "utils/lsyscache.h"
#include "utils/hashutils.h"
#include "utils/memutils.h"
#include "lib/simplehash.h"
Include dependency graph for execGrouping.c:

Go to the source code of this file.

Macros

#define SH_PREFIX   tuplehash
 
#define SH_ELEMENT_TYPE   TupleHashEntryData
 
#define SH_KEY_TYPE   MinimalTuple
 
#define SH_KEY   firstTuple
 
#define SH_HASH_KEY(tb, key)   TupleHashTableHash(tb, key)
 
#define SH_EQUAL(tb, a, b)   TupleHashTableMatch(tb, a, b) == 0
 
#define SH_SCOPE   extern
 
#define SH_STORE_HASH
 
#define SH_GET_HASH(tb, a)   a->hash
 
#define SH_DEFINE
 

Functions

static uint32 TupleHashTableHash (struct tuplehash_hash *tb, const MinimalTuple tuple)
 
static int TupleHashTableMatch (struct tuplehash_hash *tb, const MinimalTuple tuple1, const MinimalTuple tuple2)
 
ExprStateexecTuplesMatchPrepare (TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
 
void execTuplesHashPrepare (int numCols, const Oid *eqOperators, Oid **eqFuncOids, FmgrInfo **hashFunctions)
 
TupleHashTable BuildTupleHashTableExt (PlanState *parent, TupleDesc inputDesc, int numCols, AttrNumber *keyColIdx, const Oid *eqfuncoids, FmgrInfo *hashfunctions, Oid *collations, long nbuckets, Size additionalsize, MemoryContext metacxt, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
 
TupleHashTable BuildTupleHashTable (PlanState *parent, TupleDesc inputDesc, int numCols, AttrNumber *keyColIdx, const Oid *eqfuncoids, FmgrInfo *hashfunctions, Oid *collations, long nbuckets, Size additionalsize, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
 
void ResetTupleHashTable (TupleHashTable hashtable)
 
TupleHashEntry LookupTupleHashEntry (TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew)
 
TupleHashEntry FindTupleHashEntry (TupleHashTable hashtable, TupleTableSlot *slot, ExprState *eqcomp, FmgrInfo *hashfunctions)
 

Macro Definition Documentation

◆ SH_DEFINE

#define SH_DEFINE

Definition at line 45 of file execGrouping.c.

◆ SH_ELEMENT_TYPE

#define SH_ELEMENT_TYPE   TupleHashEntryData

Definition at line 37 of file execGrouping.c.

◆ SH_EQUAL

#define SH_EQUAL (   tb,
  a,
 
)    TupleHashTableMatch(tb, a, b) == 0

Definition at line 41 of file execGrouping.c.

◆ SH_GET_HASH

#define SH_GET_HASH (   tb,
 
)    a->hash

Definition at line 44 of file execGrouping.c.

◆ SH_HASH_KEY

#define SH_HASH_KEY (   tb,
  key 
)    TupleHashTableHash(tb, key)

Definition at line 40 of file execGrouping.c.

◆ SH_KEY

#define SH_KEY   firstTuple

Definition at line 39 of file execGrouping.c.

◆ SH_KEY_TYPE

#define SH_KEY_TYPE   MinimalTuple

Definition at line 38 of file execGrouping.c.

◆ SH_PREFIX

#define SH_PREFIX   tuplehash

Definition at line 36 of file execGrouping.c.

◆ SH_SCOPE

#define SH_SCOPE   extern

Definition at line 42 of file execGrouping.c.

◆ SH_STORE_HASH

#define SH_STORE_HASH

Definition at line 43 of file execGrouping.c.

Function Documentation

◆ BuildTupleHashTable()

TupleHashTable BuildTupleHashTable ( PlanState parent,
TupleDesc  inputDesc,
int  numCols,
AttrNumber keyColIdx,
const Oid eqfuncoids,
FmgrInfo hashfunctions,
Oid collations,
long  nbuckets,
Size  additionalsize,
MemoryContext  tablecxt,
MemoryContext  tempcxt,
bool  use_variable_hash_iv 
)

Definition at line 241 of file execGrouping.c.

References BuildTupleHashTableExt().

251 {
252  return BuildTupleHashTableExt(parent,
253  inputDesc,
254  numCols, keyColIdx,
255  eqfuncoids,
256  hashfunctions,
257  collations,
258  nbuckets, additionalsize,
259  tablecxt,
260  tablecxt,
261  tempcxt,
262  use_variable_hash_iv);
263 }
TupleHashTable BuildTupleHashTableExt(PlanState *parent, TupleDesc inputDesc, int numCols, AttrNumber *keyColIdx, const Oid *eqfuncoids, FmgrInfo *hashfunctions, Oid *collations, long nbuckets, Size additionalsize, MemoryContext metacxt, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
Definition: execGrouping.c:154

◆ BuildTupleHashTableExt()

TupleHashTable BuildTupleHashTableExt ( PlanState parent,
TupleDesc  inputDesc,
int  numCols,
AttrNumber keyColIdx,
const Oid eqfuncoids,
FmgrInfo hashfunctions,
Oid collations,
long  nbuckets,
Size  additionalsize,
MemoryContext  metacxt,
MemoryContext  tablecxt,
MemoryContext  tempcxt,
bool  use_variable_hash_iv 
)

Definition at line 154 of file execGrouping.c.

References Assert, CreateStandaloneExprContext(), CreateTupleDescCopy(), TupleHashTableData::cur_eq_func, TupleHashTableData::entrysize, ExecBuildGroupingEqual(), TupleHashTableData::exprcontext, TupleHashTableData::hash_iv, TupleHashTableData::hashtab, TupleHashTableData::in_hash_funcs, TupleHashTableData::inputslot, TupleHashTableData::keyColIdx, MakeSingleTupleTableSlot(), MemoryContextSwitchTo(), Min, murmurhash32(), TupleHashTableData::numCols, palloc(), ParallelWorkerNumber, TupleHashTableData::tab_collations, TupleHashTableData::tab_eq_func, TupleHashTableData::tab_hash_funcs, TupleHashTableData::tablecxt, TupleHashTableData::tableslot, TupleHashTableData::tempcxt, TTSOpsMinimalTuple, and work_mem.

Referenced by build_hash_table(), buildSubPlanHash(), and BuildTupleHashTable().

165 {
166  TupleHashTable hashtable;
167  Size entrysize = sizeof(TupleHashEntryData) + additionalsize;
168  MemoryContext oldcontext;
169 
170  Assert(nbuckets > 0);
171 
172  /* Limit initial table size request to not more than work_mem */
173  nbuckets = Min(nbuckets, (long) ((work_mem * 1024L) / entrysize));
174 
175  oldcontext = MemoryContextSwitchTo(metacxt);
176 
177  hashtable = (TupleHashTable) palloc(sizeof(TupleHashTableData));
178 
179  hashtable->numCols = numCols;
180  hashtable->keyColIdx = keyColIdx;
181  hashtable->tab_hash_funcs = hashfunctions;
182  hashtable->tab_collations = collations;
183  hashtable->tablecxt = tablecxt;
184  hashtable->tempcxt = tempcxt;
185  hashtable->entrysize = entrysize;
186  hashtable->tableslot = NULL; /* will be made on first lookup */
187  hashtable->inputslot = NULL;
188  hashtable->in_hash_funcs = NULL;
189  hashtable->cur_eq_func = NULL;
190 
191  /*
192  * If parallelism is in use, even if the master backend is performing the
193  * scan itself, we don't want to create the hashtable exactly the same way
194  * in all workers. As hashtables are iterated over in keyspace-order,
195  * doing so in all processes in the same way is likely to lead to
196  * "unbalanced" hashtables when the table size initially is
197  * underestimated.
198  */
199  if (use_variable_hash_iv)
201  else
202  hashtable->hash_iv = 0;
203 
204  hashtable->hashtab = tuplehash_create(metacxt, nbuckets, hashtable);
205 
206  /*
207  * We copy the input tuple descriptor just for safety --- we assume all
208  * input tuples will have equivalent descriptors.
209  */
212 
213  /* build comparator for all columns */
214  /* XXX: should we support non-minimal tuples for the inputslot? */
215  hashtable->tab_eq_func = ExecBuildGroupingEqual(inputDesc, inputDesc,
217  numCols,
218  keyColIdx, eqfuncoids, collations,
219  NULL);
220 
221  /*
222  * While not pretty, it's ok to not shut down this context, but instead
223  * rely on the containing memory context being reset, as
224  * ExecBuildGroupingEqual() only builds a very simple expression calling
225  * functions (i.e. nothing that'd employ RegisterExprContextCallback()).
226  */
228 
229  MemoryContextSwitchTo(oldcontext);
230 
231  return hashtable;
232 }
ExprContext * exprcontext
Definition: execnodes.h:713
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:318
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
Definition: tupdesc.c:110
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1203
ExprState * ExecBuildGroupingEqual(TupleDesc ldesc, TupleDesc rdesc, const TupleTableSlotOps *lops, const TupleTableSlotOps *rops, int numCols, const AttrNumber *keyColIdx, const Oid *eqfunctions, const Oid *collations, PlanState *parent)
Definition: execExpr.c:3316
TupleTableSlot * inputslot
Definition: execnodes.h:709
#define Min(x, y)
Definition: c.h:904
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
AttrNumber * keyColIdx
Definition: execnodes.h:700
ExprState * tab_eq_func
Definition: execnodes.h:702
ExprState * cur_eq_func
Definition: execnodes.h:711
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:701
FmgrInfo * in_hash_funcs
Definition: execnodes.h:710
struct TupleHashEntryData TupleHashEntryData
MemoryContext tablecxt
Definition: execnodes.h:704
struct TupleHashTableData * TupleHashTable
Definition: execnodes.h:678
int ParallelWorkerNumber
Definition: parallel.c:110
int work_mem
Definition: globals.c:121
tuplehash_hash * hashtab
Definition: execnodes.h:698
#define Assert(condition)
Definition: c.h:732
TupleTableSlot * tableslot
Definition: execnodes.h:707
size_t Size
Definition: c.h:466
void * palloc(Size size)
Definition: mcxt.c:924
static uint32 murmurhash32(uint32 data)
Definition: hashutils.h:60
MemoryContext tempcxt
Definition: execnodes.h:705
const TupleTableSlotOps TTSOpsMinimalTuple
Definition: execTuples.c:86

◆ execTuplesHashPrepare()

void execTuplesHashPrepare ( int  numCols,
const Oid eqOperators,
Oid **  eqFuncOids,
FmgrInfo **  hashFunctions 
)

Definition at line 96 of file execGrouping.c.

References Assert, elog, ERROR, fmgr_info(), get_op_hash_functions(), get_opcode(), i, and palloc().

Referenced by ExecInitRecursiveUnion(), ExecInitSetOp(), and find_hash_columns().

100 {
101  int i;
102 
103  *eqFuncOids = (Oid *) palloc(numCols * sizeof(Oid));
104  *hashFunctions = (FmgrInfo *) palloc(numCols * sizeof(FmgrInfo));
105 
106  for (i = 0; i < numCols; i++)
107  {
108  Oid eq_opr = eqOperators[i];
109  Oid eq_function;
110  Oid left_hash_function;
111  Oid right_hash_function;
112 
113  eq_function = get_opcode(eq_opr);
114  if (!get_op_hash_functions(eq_opr,
115  &left_hash_function, &right_hash_function))
116  elog(ERROR, "could not find hash function for hash operator %u",
117  eq_opr);
118  /* We're not supporting cross-type cases here */
119  Assert(left_hash_function == right_hash_function);
120  (*eqFuncOids)[i] = eq_function;
121  fmgr_info(right_hash_function, &(*hashFunctions)[i]);
122  }
123 }
Definition: fmgr.h:56
bool get_op_hash_functions(Oid opno, RegProcedure *lhs_procno, RegProcedure *rhs_procno)
Definition: lsyscache.c:507
unsigned int Oid
Definition: postgres_ext.h:31
#define ERROR
Definition: elog.h:43
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:124
RegProcedure get_opcode(Oid opno)
Definition: lsyscache.c:1092
#define Assert(condition)
Definition: c.h:732
void * palloc(Size size)
Definition: mcxt.c:924
#define elog(elevel,...)
Definition: elog.h:226
int i

◆ execTuplesMatchPrepare()

ExprState* execTuplesMatchPrepare ( TupleDesc  desc,
int  numCols,
const AttrNumber keyColIdx,
const Oid eqOperators,
const Oid collations,
PlanState parent 
)

Definition at line 59 of file execGrouping.c.

References ExecBuildGroupingEqual(), get_opcode(), i, and palloc().

Referenced by build_pertrans_for_aggref(), ExecInitAgg(), ExecInitGroup(), ExecInitSetOp(), ExecInitUnique(), ExecInitWindowAgg(), and hypothetical_dense_rank_final().

65 {
66  Oid *eqFunctions = (Oid *) palloc(numCols * sizeof(Oid));
67  int i;
68  ExprState *expr;
69 
70  if (numCols == 0)
71  return NULL;
72 
73  /* lookup equality functions */
74  for (i = 0; i < numCols; i++)
75  eqFunctions[i] = get_opcode(eqOperators[i]);
76 
77  /* build actual expression */
78  expr = ExecBuildGroupingEqual(desc, desc, NULL, NULL,
79  numCols, keyColIdx, eqFunctions, collations,
80  parent);
81 
82  return expr;
83 }
ExprState * ExecBuildGroupingEqual(TupleDesc ldesc, TupleDesc rdesc, const TupleTableSlotOps *lops, const TupleTableSlotOps *rops, int numCols, const AttrNumber *keyColIdx, const Oid *eqfunctions, const Oid *collations, PlanState *parent)
Definition: execExpr.c:3316
unsigned int Oid
Definition: postgres_ext.h:31
RegProcedure get_opcode(Oid opno)
Definition: lsyscache.c:1092
void * palloc(Size size)
Definition: mcxt.c:924
int i

◆ FindTupleHashEntry()

TupleHashEntry FindTupleHashEntry ( TupleHashTable  hashtable,
TupleTableSlot slot,
ExprState eqcomp,
FmgrInfo hashfunctions 
)

Definition at line 347 of file execGrouping.c.

References TupleHashTableData::cur_eq_func, TupleHashTableData::hashtab, TupleHashTableData::in_hash_funcs, TupleHashTableData::inputslot, sort-test::key, MemoryContextSwitchTo(), and TupleHashTableData::tempcxt.

Referenced by ExecHashSubPlan().

350 {
351  TupleHashEntry entry;
352  MemoryContext oldContext;
354 
355  /* Need to run the hash functions in short-lived context */
356  oldContext = MemoryContextSwitchTo(hashtable->tempcxt);
357 
358  /* Set up data needed by hash and match functions */
359  hashtable->inputslot = slot;
360  hashtable->in_hash_funcs = hashfunctions;
361  hashtable->cur_eq_func = eqcomp;
362 
363  /* Search the hash table */
364  key = NULL; /* flag to reference inputslot */
365  entry = tuplehash_lookup(hashtable->hashtab, key);
366  MemoryContextSwitchTo(oldContext);
367 
368  return entry;
369 }
TupleTableSlot * inputslot
Definition: execnodes.h:709
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
ExprState * cur_eq_func
Definition: execnodes.h:711
FmgrInfo * in_hash_funcs
Definition: execnodes.h:710
tuplehash_hash * hashtab
Definition: execnodes.h:698
MemoryContext tempcxt
Definition: execnodes.h:705

◆ LookupTupleHashEntry()

TupleHashEntry LookupTupleHashEntry ( TupleHashTable  hashtable,
TupleTableSlot slot,
bool isnew 
)

Definition at line 289 of file execGrouping.c.

References TupleHashEntryData::additional, TupleHashTableData::cur_eq_func, ExecCopySlotMinimalTuple(), TupleHashEntryData::firstTuple, TupleHashTableData::hashtab, TupleHashTableData::in_hash_funcs, TupleHashTableData::inputslot, sort-test::key, MemoryContextSwitchTo(), TupleHashTableData::tab_eq_func, TupleHashTableData::tab_hash_funcs, TupleHashTableData::tablecxt, and TupleHashTableData::tempcxt.

Referenced by buildSubPlanHash(), ExecRecursiveUnion(), lookup_hash_entry(), and setop_fill_hash_table().

291 {
292  TupleHashEntryData *entry;
293  MemoryContext oldContext;
294  bool found;
296 
297  /* Need to run the hash functions in short-lived context */
298  oldContext = MemoryContextSwitchTo(hashtable->tempcxt);
299 
300  /* set up data needed by hash and match functions */
301  hashtable->inputslot = slot;
302  hashtable->in_hash_funcs = hashtable->tab_hash_funcs;
303  hashtable->cur_eq_func = hashtable->tab_eq_func;
304 
305  key = NULL; /* flag to reference inputslot */
306 
307  if (isnew)
308  {
309  entry = tuplehash_insert(hashtable->hashtab, key, &found);
310 
311  if (found)
312  {
313  /* found pre-existing entry */
314  *isnew = false;
315  }
316  else
317  {
318  /* created new entry */
319  *isnew = true;
320  /* zero caller data */
321  entry->additional = NULL;
322  MemoryContextSwitchTo(hashtable->tablecxt);
323  /* Copy the first tuple into the table context */
324  entry->firstTuple = ExecCopySlotMinimalTuple(slot);
325  }
326  }
327  else
328  {
329  entry = tuplehash_lookup(hashtable->hashtab, key);
330  }
331 
332  MemoryContextSwitchTo(oldContext);
333 
334  return entry;
335 }
TupleTableSlot * inputslot
Definition: execnodes.h:709
MinimalTuple firstTuple
Definition: execnodes.h:682
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
ExprState * tab_eq_func
Definition: execnodes.h:702
ExprState * cur_eq_func
Definition: execnodes.h:711
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:701
FmgrInfo * in_hash_funcs
Definition: execnodes.h:710
static MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot)
Definition: tuptable.h:464
MemoryContext tablecxt
Definition: execnodes.h:704
tuplehash_hash * hashtab
Definition: execnodes.h:698
MemoryContext tempcxt
Definition: execnodes.h:705

◆ ResetTupleHashTable()

void ResetTupleHashTable ( TupleHashTable  hashtable)

Definition at line 271 of file execGrouping.c.

References TupleHashTableData::hashtab.

Referenced by build_hash_table(), buildSubPlanHash(), ExecReScanRecursiveUnion(), and ExecReScanSetOp().

272 {
273  tuplehash_reset(hashtable->hashtab);
274 }
tuplehash_hash * hashtab
Definition: execnodes.h:698

◆ TupleHashTableHash()

static uint32 TupleHashTableHash ( struct tuplehash_hash *  tb,
const MinimalTuple  tuple 
)
static

Definition at line 385 of file execGrouping.c.

References DatumGetUInt32, ExecStoreMinimalTuple(), FunctionCall1Coll(), TupleHashTableData::hash_iv, i, TupleHashTableData::in_hash_funcs, TupleHashTableData::inputslot, TupleHashTableData::keyColIdx, murmurhash32(), TupleHashTableData::numCols, slot_getattr(), TupleHashTableData::tab_collations, TupleHashTableData::tab_hash_funcs, and TupleHashTableData::tableslot.

386 {
387  TupleHashTable hashtable = (TupleHashTable) tb->private_data;
388  int numCols = hashtable->numCols;
389  AttrNumber *keyColIdx = hashtable->keyColIdx;
390  uint32 hashkey = hashtable->hash_iv;
391  TupleTableSlot *slot;
392  FmgrInfo *hashfunctions;
393  int i;
394 
395  if (tuple == NULL)
396  {
397  /* Process the current input tuple for the table */
398  slot = hashtable->inputslot;
399  hashfunctions = hashtable->in_hash_funcs;
400  }
401  else
402  {
403  /*
404  * Process a tuple already stored in the table.
405  *
406  * (this case never actually occurs due to the way simplehash.h is
407  * used, as the hash-value is stored in the entries)
408  */
409  slot = hashtable->tableslot;
410  ExecStoreMinimalTuple(tuple, slot, false);
411  hashfunctions = hashtable->tab_hash_funcs;
412  }
413 
414  for (i = 0; i < numCols; i++)
415  {
416  AttrNumber att = keyColIdx[i];
417  Datum attr;
418  bool isNull;
419 
420  /* rotate hashkey left 1 bit at each step */
421  hashkey = (hashkey << 1) | ((hashkey & 0x80000000) ? 1 : 0);
422 
423  attr = slot_getattr(slot, att, &isNull);
424 
425  if (!isNull) /* treat nulls as having hash key 0 */
426  {
427  uint32 hkey;
428 
429  hkey = DatumGetUInt32(FunctionCall1Coll(&hashfunctions[i],
430  hashtable->tab_collations[i],
431  attr));
432  hashkey ^= hkey;
433  }
434  }
435 
436  /*
437  * The way hashes are combined above, among each other and with the IV,
438  * doesn't lead to good bit perturbation. As the IV's goal is to lead to
439  * achieve that, perform a round of hashing of the combined hash -
440  * resulting in near perfect perturbation.
441  */
442  return murmurhash32(hashkey);
443 }
#define DatumGetUInt32(X)
Definition: postgres.h:486
Definition: fmgr.h:56
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
Definition: execTuples.c:1411
TupleTableSlot * inputslot
Definition: execnodes.h:709
AttrNumber * keyColIdx
Definition: execnodes.h:700
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:701
FmgrInfo * in_hash_funcs
Definition: execnodes.h:710
struct TupleHashTableData * TupleHashTable
Definition: execnodes.h:678
unsigned int uint32
Definition: c.h:358
uintptr_t Datum
Definition: postgres.h:367
Datum FunctionCall1Coll(FmgrInfo *flinfo, Oid collation, Datum arg1)
Definition: fmgr.c:1130
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:382
TupleTableSlot * tableslot
Definition: execnodes.h:707
int i
static uint32 murmurhash32(uint32 data)
Definition: hashutils.h:60
int16 AttrNumber
Definition: attnum.h:21

◆ TupleHashTableMatch()

static int TupleHashTableMatch ( struct tuplehash_hash *  tb,
const MinimalTuple  tuple1,
const MinimalTuple  tuple2 
)
static

Definition at line 451 of file execGrouping.c.

References Assert, TupleHashTableData::cur_eq_func, ExecQualAndReset(), ExecStoreMinimalTuple(), TupleHashTableData::exprcontext, TupleHashTableData::inputslot, and TupleHashTableData::tableslot.

452 {
453  TupleTableSlot *slot1;
454  TupleTableSlot *slot2;
455  TupleHashTable hashtable = (TupleHashTable) tb->private_data;
456  ExprContext *econtext = hashtable->exprcontext;
457 
458  /*
459  * We assume that simplehash.h will only ever call us with the first
460  * argument being an actual table entry, and the second argument being
461  * LookupTupleHashEntry's dummy TupleHashEntryData. The other direction
462  * could be supported too, but is not currently required.
463  */
464  Assert(tuple1 != NULL);
465  slot1 = hashtable->tableslot;
466  ExecStoreMinimalTuple(tuple1, slot1, false);
467  Assert(tuple2 == NULL);
468  slot2 = hashtable->inputslot;
469 
470  /* For crosstype comparisons, the inputslot must be first */
471  econtext->ecxt_innertuple = slot2;
472  econtext->ecxt_outertuple = slot1;
473  return !ExecQualAndReset(hashtable->cur_eq_func, econtext);
474 }
ExprContext * exprcontext
Definition: execnodes.h:713
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
Definition: execTuples.c:1411
TupleTableSlot * inputslot
Definition: execnodes.h:709
ExprState * cur_eq_func
Definition: execnodes.h:711
struct TupleHashTableData * TupleHashTable
Definition: execnodes.h:678
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
Definition: executor.h:392
#define Assert(condition)
Definition: c.h:732
TupleTableSlot * tableslot
Definition: execnodes.h:707