mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
tableam: Support for an index build's initial table scan(s).
To support building indexes over tables of different AMs, the scans to do so need to be routed through the table AM. While moving a fair amount of code, nearly all the changes are just moving code to below a callback. Currently the range based interface wouldn't make much sense for non block based table AMs. But that seems aceptable for now. Author: Andres Freund Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#include "access/gin_private.h"
|
||||
#include "access/ginxlog.h"
|
||||
#include "access/xloginsert.h"
|
||||
#include "access/tableam.h"
|
||||
#include "catalog/index.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/bufmgr.h"
|
||||
@ -394,8 +395,9 @@ ginbuild(Relation heap, Relation index, IndexInfo *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, NULL);
|
||||
reltuples = table_index_build_scan(heap, index, indexInfo, false,
|
||||
ginBuildCallback, (void *) &buildstate,
|
||||
NULL);
|
||||
|
||||
/* dump remaining entries to the index */
|
||||
oldCtx = MemoryContextSwitchTo(buildstate.tmpCtx);
|
||||
|
Reference in New Issue
Block a user