mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +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:
@ -14,6 +14,7 @@
|
||||
|
||||
#include "access/genam.h"
|
||||
#include "access/generic_xlog.h"
|
||||
#include "access/tableam.h"
|
||||
#include "catalog/index.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/bufmgr.h"
|
||||
@ -69,7 +70,7 @@ initCachedPage(BloomBuildState *buildstate)
|
||||
}
|
||||
|
||||
/*
|
||||
* Per-tuple callback from IndexBuildHeapScan.
|
||||
* Per-tuple callback for table_index_build_scan.
|
||||
*/
|
||||
static void
|
||||
bloomBuildCallback(Relation index, HeapTuple htup, Datum *values,
|
||||
@ -141,9 +142,9 @@ blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
|
||||
initCachedPage(&buildstate);
|
||||
|
||||
/* Do the heap scan */
|
||||
reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
|
||||
bloomBuildCallback, (void *) &buildstate,
|
||||
NULL);
|
||||
reltuples = table_index_build_scan(heap, index, indexInfo, true,
|
||||
bloomBuildCallback, (void *) &buildstate,
|
||||
NULL);
|
||||
|
||||
/* Flush last page if needed (it will be, unless heap was empty) */
|
||||
if (buildstate.count > 0)
|
||||
|
Reference in New Issue
Block a user