mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-07 21:42:56 +00:00
This way, the callers don't need to do it, reducing the footprint of changes we've had to made to various index AM's build functions.
38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
diff --git a/src/ruminsert.c b/src/ruminsert.c
|
|
index 255e616..1c6edb7 100644
|
|
--- a/src/ruminsert.c
|
|
+++ b/src/ruminsert.c
|
|
@@ -628,6 +628,10 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
|
|
elog(ERROR, "index \"%s\" already contains data",
|
|
RelationGetRelationName(index));
|
|
|
|
+#ifdef NEON_SMGR
|
|
+ smgr_start_unlogged_build(index->rd_smgr);
|
|
+#endif
|
|
+
|
|
initRumState(&buildstate.rumstate, index);
|
|
buildstate.rumstate.isBuild = true;
|
|
buildstate.indtuples = 0;
|
|
@@ -693,6 +697,10 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
|
|
buildstate.buildStats.nTotalPages = RelationGetNumberOfBlocks(index);
|
|
rumUpdateStats(index, &buildstate.buildStats, buildstate.rumstate.isBuild);
|
|
|
|
+#ifdef NEON_SMGR
|
|
+ smgr_finish_unlogged_build_phase_1(index->rd_smgr);
|
|
+#endif
|
|
+
|
|
/*
|
|
* Write index to xlog
|
|
*/
|
|
@@ -713,6 +721,10 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
|
|
UnlockReleaseBuffer(buffer);
|
|
}
|
|
|
|
+#ifdef NEON_SMGR
|
|
+ smgr_end_unlogged_build(index->rd_smgr);
|
|
+#endif
|
|
+
|
|
/*
|
|
* Return statistics
|
|
*/
|