diff options
author | Andres Freund <andres@anarazel.de> | 2019-03-27 19:59:06 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2019-03-27 19:59:06 -0700 |
commit | 2a96909a4a8c38705163b83a81b228d5aec197f9 (patch) | |
tree | 566d1b8848467ad68ca336a602ac5ab49a476d69 /src/backend/access/gin/gininsert.c | |
parent | 12bb35fc9b000d462b9bd6b8856e1884ef1bb3d7 (diff) | |
download | postgresql-2a96909a4a8c38705163b83a81b228d5aec197f9.tar.gz postgresql-2a96909a4a8c38705163b83a81b228d5aec197f9.zip |
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
Diffstat (limited to 'src/backend/access/gin/gininsert.c')
-rw-r--r-- | src/backend/access/gin/gininsert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c index 524ac5be8b5..b02f69b0dcb 100644 --- a/src/backend/access/gin/gininsert.c +++ b/src/backend/access/gin/gininsert.c @@ -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); |