88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.18 2006/03/05 15:58:25 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.19 2006/06/28 17:05:49 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -389,7 +389,7 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
389389
390390/* Copy the first tuple into the table context */
391391MemoryContextSwitchTo (hashtable -> tablecxt );
392- entry -> firstTuple = ExecCopySlotTuple (slot );
392+ entry -> firstTuple = ExecCopySlotMinimalTuple (slot );
393393
394394* isnew = true;
395395}
@@ -405,23 +405,23 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
405405/*
406406 * Compute the hash value for a tuple
407407 *
408- * The passed-in key is a pointer to TupleHashEntryData. In an actual
409- *hash table entry, the firstTuple fieldtherein points to aphysical
410- *tuple . LookupTupleHashEntry sets up a dummy TupleHashEntryData with
411- *a NULL firstTuple field --- that cues us to look at the inputslot instead.
412- * This convention avoids the need to materialize virtual input tuples
413- *unless they actually need to get copied into the table.
408+ * The passed-in key is a pointer to TupleHashEntryData. In an actual hash
409+ * table entry, the firstTuple field points to atuple (in MinimalTuple
410+ *format) . LookupTupleHashEntry sets up a dummy TupleHashEntryData with a
411+ * NULL firstTuple field --- that cues us to look at the inputslot instead.
412+ * This convention avoids the need to materialize virtual input tuples unless
413+ * they actually need to get copied into the table.
414414 *
415415 * CurTupleHashTable must be set before calling this, since dynahash.c
416416 * doesn't provide any API that would let us get at the hashtable otherwise.
417417 *
418418 * Also, the caller must select an appropriate memory context for running
419- * the hash functions. (dynahash.c doesn't change CurrentMemoryContext.)
419+ * the hash functions. (dynahash.c doesn't change CurrentMemoryContext.)
420420 */
421421static uint32
422422TupleHashTableHash (const void * key ,Size keysize )
423423{
424- HeapTuple tuple = ((const TupleHashEntryData * )key )-> firstTuple ;
424+ MinimalTuple tuple = ((const TupleHashEntryData * )key )-> firstTuple ;
425425TupleTableSlot * slot ;
426426TupleHashTable hashtable = CurTupleHashTable ;
427427int numCols = hashtable -> numCols ;
@@ -439,7 +439,7 @@ TupleHashTableHash(const void *key, Size keysize)
439439/* Process a tuple already stored in the table */
440440/* (this case never actually occurs in current dynahash.c code) */
441441slot = hashtable -> tableslot ;
442- ExecStoreTuple (tuple ,slot , InvalidBuffer , false);
442+ ExecStoreMinimalTuple (tuple ,slot , false);
443443}
444444
445445for (i = 0 ;i < numCols ;i ++ )
@@ -480,10 +480,10 @@ TupleHashTableHash(const void *key, Size keysize)
480480static int
481481TupleHashTableMatch (const void * key1 ,const void * key2 ,Size keysize )
482482{
483- HeapTuple tuple1 = ((const TupleHashEntryData * )key1 )-> firstTuple ;
483+ MinimalTuple tuple1 = ((const TupleHashEntryData * )key1 )-> firstTuple ;
484484
485485#ifdef USE_ASSERT_CHECKING
486- HeapTuple tuple2 = ((const TupleHashEntryData * )key2 )-> firstTuple ;
486+ MinimalTuple tuple2 = ((const TupleHashEntryData * )key2 )-> firstTuple ;
487487#endif
488488TupleTableSlot * slot1 ;
489489TupleTableSlot * slot2 ;
@@ -497,7 +497,7 @@ TupleHashTableMatch(const void *key1, const void *key2, Size keysize)
497497 */
498498Assert (tuple1 != NULL );
499499slot1 = hashtable -> tableslot ;
500- ExecStoreTuple (tuple1 ,slot1 , InvalidBuffer , false);
500+ ExecStoreMinimalTuple (tuple1 ,slot1 , false);
501501Assert (tuple2 == NULL );
502502slot2 = hashtable -> inputslot ;
503503