src/backend/access/hash/hashsort.c
void
_h_indexbuild(HSpool *hspool)
{
	IndexTuple	itup;
#ifdef USE_ASSERT_CHECKING
	uint32		hashkey = 0;
#endif

	tuplesort_performsort(hspool->sortstate);

	while ((itup = tuplesort_getindextuple(hspool->sortstate, true)) != NULL)
	{
		/*
		 * Technically, it isn't critical that hash keys be found in sorted
		 * order, since this sorting is only used to increase locality of
		 * access as a performance optimization.  It still seems like a good
		 * idea to test tuplesort.c's handling of hash index tuple sorts
		 * through an assertion, though.
		 */
#ifdef USE_ASSERT_CHECKING
		uint32		lasthashkey = hashkey;

		hashkey = _hash_get_indextuple_hashkey(itup) & hspool->hash_mask;
		Assert(hashkey >= lasthashkey);
#endif

		_hash_doinsert(hspool->index, itup);
	}
}
/*
 * given a spool loaded by successive calls to _h_spool,
 * create an entire index.
 */
given a spool loaded by successive calls to _h_spool,
create an entire index.
given a spool loaded by successive calls to _h_spool create an entire index .
void
_h_indexbuild(HSpool *hspool)
{
	IndexTuple	itup;
#ifdef USE_ASSERT_CHECKING
	uint32		hashkey = 0;
#endif
	tuplesort_performsort(hspool->sortstate);
	while ((itup = tuplesort_getindextuple(hspool->sortstate, true)) != NULL)
	{
#ifdef USE_ASSERT_CHECKING
		uint32		lasthashkey = hashkey;
		hashkey = _hash_get_indextuple_hashkey(itup) & hspool->hash_mask;
		Assert(hashkey >= lasthashkey);
#endif
		_hash_doinsert(hspool->index, itup);
	}
}
void _h_indexbuild ( HSpool * hspool ) { IndexTuple itup ; #ifdef USE_ASSERT_CHECKING uint32 hashkey = 0 ; #endif tuplesort_performsort ( hspool -> sortstate ) ; while ( ( itup = tuplesort_getindextuple ( hspool -> sortstate , true ) ) != NULL ) { #ifdef USE_ASSERT_CHECKING uint32 lasthashkey = hashkey ; hashkey = _hash_get_indextuple_hashkey ( itup ) & hspool -> hash_mask ; Assert ( hashkey >= lasthashkey ) ; #endif _hash_doinsert ( hspool -> index , itup ) ; } }
given a spool loaded by successive calls to _h_spool,
 create an entire index.
given a spool loaded by successive calls to _h_spool create an entire index .
/*
		 * Technically, it isn't critical that hash keys be found in sorted
		 * order, since this sorting is only used to increase locality of
		 * access as a performance optimization.  It still seems like a good
		 * idea to test tuplesort.c's handling of hash index tuple sorts
		 * through an assertion, though.
		 */