From 4d8a8d0c738410ec02aab46b1ebe1835365ad384 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Wed, 15 Jan 2020 07:24:14 +0530 Subject: Introduce IndexAM fields for parallel vacuum. Introduce new fields amusemaintenanceworkmem and amparallelvacuumoptions in IndexAmRoutine for parallel vacuum. The amusemaintenanceworkmem tells whether a particular IndexAM uses maintenance_work_mem or not. This will help in controlling the memory used by individual workers as otherwise, each worker can consume memory equal to maintenance_work_mem. The amparallelvacuumoptions tell whether a particular IndexAM participates in a parallel vacuum and if so in which phase (bulkdelete, vacuumcleanup) of vacuum. Author: Masahiko Sawada and Amit Kapila Reviewed-by: Dilip Kumar, Amit Kapila, Tomas Vondra and Robert Haas Discussion: https://postgr.es/m/CAD21AoDTPMgzSkV4E3SFo1CH_x50bf5PqZFQf4jmqjk-C03BWg@mail.gmail.com https://postgr.es/m/CAA4eK1LmcD5aPogzwim5Nn58Ki+74a6Edghx4Wd8hAskvHaq5A@mail.gmail.com --- src/test/modules/dummy_index_am/dummy_index_am.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/test') diff --git a/src/test/modules/dummy_index_am/dummy_index_am.c b/src/test/modules/dummy_index_am/dummy_index_am.c index 898ab066391..f32632089b1 100644 --- a/src/test/modules/dummy_index_am/dummy_index_am.c +++ b/src/test/modules/dummy_index_am/dummy_index_am.c @@ -16,6 +16,7 @@ #include "access/amapi.h" #include "access/reloptions.h" #include "catalog/index.h" +#include "commands/vacuum.h" #include "nodes/pathnodes.h" #include "utils/guc.h" #include "utils/rel.h" @@ -294,6 +295,8 @@ dihandler(PG_FUNCTION_ARGS) amroutine->ampredlocks = false; amroutine->amcanparallel = false; amroutine->amcaninclude = false; + amroutine->amusemaintenanceworkmem = false; + amroutine->amparallelvacuumoptions = VACUUM_OPTION_NO_PARALLEL; amroutine->amkeytype = InvalidOid; amroutine->ambuild = dibuild; -- cgit v1.2.3