From ea99957fae859ad671a597f293d3e0a1ab092736 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 22 Aug 2024 20:39:16 -0700 Subject: [PATCH] Added fields to IndexAmRoutine --- src/hnsw.c | 11 +++++++++++ src/ivfflat.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/hnsw.c b/src/hnsw.c index 0850a69..72dd6a7 100644 --- a/src/hnsw.c +++ b/src/hnsw.c @@ -210,9 +210,17 @@ hnswhandler(PG_FUNCTION_ARGS) amroutine->amclusterable = false; amroutine->ampredlocks = false; amroutine->amcanparallel = false; +#if PG_VERSION_NUM >= 170000 + amroutine->amcanbuildparallel = true; +#endif amroutine->amcaninclude = false; #if PG_VERSION_NUM >= 130000 amroutine->amusemaintenanceworkmem = false; /* not used during VACUUM */ +#endif +#if PG_VERSION_NUM >= 160000 + amroutine->amsummarizing = false; +#endif +#if PG_VERSION_NUM >= 130000 amroutine->amparallelvacuumoptions = VACUUM_OPTION_PARALLEL_BULKDEL; #endif amroutine->amkeytype = InvalidOid; @@ -221,6 +229,9 @@ hnswhandler(PG_FUNCTION_ARGS) amroutine->ambuild = hnswbuild; amroutine->ambuildempty = hnswbuildempty; amroutine->aminsert = hnswinsert; +#if PG_VERSION_NUM >= 170000 + amroutine->aminsertcleanup = NULL; +#endif amroutine->ambulkdelete = hnswbulkdelete; amroutine->amvacuumcleanup = hnswvacuumcleanup; amroutine->amcanreturn = NULL; diff --git a/src/ivfflat.c b/src/ivfflat.c index 415579b..9aca936 100644 --- a/src/ivfflat.c +++ b/src/ivfflat.c @@ -204,9 +204,17 @@ ivfflathandler(PG_FUNCTION_ARGS) amroutine->amclusterable = false; amroutine->ampredlocks = false; amroutine->amcanparallel = false; +#if PG_VERSION_NUM >= 170000 + amroutine->amcanbuildparallel = true; +#endif amroutine->amcaninclude = false; #if PG_VERSION_NUM >= 130000 amroutine->amusemaintenanceworkmem = false; /* not used during VACUUM */ +#endif +#if PG_VERSION_NUM >= 160000 + amroutine->amsummarizing = false; +#endif +#if PG_VERSION_NUM >= 130000 amroutine->amparallelvacuumoptions = VACUUM_OPTION_PARALLEL_BULKDEL; #endif amroutine->amkeytype = InvalidOid; @@ -215,6 +223,9 @@ ivfflathandler(PG_FUNCTION_ARGS) amroutine->ambuild = ivfflatbuild; amroutine->ambuildempty = ivfflatbuildempty; amroutine->aminsert = ivfflatinsert; +#if PG_VERSION_NUM >= 170000 + amroutine->aminsertcleanup = NULL; +#endif amroutine->ambulkdelete = ivfflatbulkdelete; amroutine->amvacuumcleanup = ivfflatvacuumcleanup; amroutine->amcanreturn = NULL; /* tuple not included in heapsort */