buildstate.accum.ginstate = &buildstate.ginstate;
ginInitBA(&buildstate.accum);
- /* do the heap scan */
- reltuples = IndexBuildHeapScan(heap, index, indexInfo,
+ /*
+ * Do the heap scan. We disallow sync scan here because dataPlaceToPage
+ * prefers to receive tuples in TID order.
+ */
+ reltuples = IndexBuildHeapScan(heap, index, indexInfo, false,
ginBuildCallback, (void *) &buildstate);
/* dump remaining entries to the index */
buildstate.tmpCtx = createTempGistContext();
/* do the heap scan */
- reltuples = IndexBuildHeapScan(heap, index, indexInfo,
+ reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
gistbuildCallback, (void *) &buildstate);
/* okay, all heap tuples are indexed */
buildstate.indtuples = 0;
/* do the heap scan */
- reltuples = IndexBuildHeapScan(heap, index, indexInfo,
+ reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
hashbuildCallback, (void *) &buildstate);
if (buildstate.spool)
buildstate.spool2 = _bt_spoolinit(index, false, true);
/* do the heap scan */
- reltuples = IndexBuildHeapScan(heap, index, indexInfo,
+ reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
btbuildCallback, (void *) &buildstate);
/* okay, all heap tuples are indexed */
IndexBuildHeapScan(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
+ bool allow_sync,
IndexBuildCallback callback,
void *callback_state)
{
OldestXmin = GetOldestXmin(heapRelation->rd_rel->relisshared, true);
}
- scan = heap_beginscan(heapRelation, snapshot, 0, NULL);
+ scan = heap_beginscan_strat(heapRelation, /* relation */
+ snapshot, /* snapshot */
+ 0, /* number of keys */
+ NULL, /* scan key */
+ true, /* buffer access strategy OK */
+ allow_sync); /* syncscan OK? */
reltuples = 0;
extern double IndexBuildHeapScan(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
+ bool allow_sync,
IndexBuildCallback callback,
void *callback_state);