summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/common/tidstore.c15
-rw-r--r--src/backend/access/heap/vacuumlazy.c4
2 files changed, 15 insertions, 4 deletions
diff --git a/src/backend/access/common/tidstore.c b/src/backend/access/common/tidstore.c
index 629390a1f88..211d63941c2 100644
--- a/src/backend/access/common/tidstore.c
+++ b/src/backend/access/common/tidstore.c
@@ -120,7 +120,7 @@ static void tidstore_iter_extract_tids(TidStoreIter *iter, BlockNumber blkno,
* by TidStoreMemoryUsage().
*/
TidStore *
-TidStoreCreateLocal(size_t max_bytes)
+TidStoreCreateLocal(size_t max_bytes, bool insert_only)
{
TidStore *ts;
size_t initBlockSize = ALLOCSET_DEFAULT_INITSIZE;
@@ -138,11 +138,22 @@ TidStoreCreateLocal(size_t max_bytes)
maxBlockSize = ALLOCSET_DEFAULT_INITSIZE;
/* Create a memory context for the TID storage */
- ts->rt_context = AllocSetContextCreate(CurrentMemoryContext,
+ if (insert_only)
+ {
+ ts->rt_context = BumpContextCreate(CurrentMemoryContext,
"TID storage",
minContextSize,
initBlockSize,
maxBlockSize);
+ }
+ else
+ {
+ ts->rt_context = AllocSetContextCreate(CurrentMemoryContext,
+ "TID storage",
+ minContextSize,
+ initBlockSize,
+ maxBlockSize);
+ }
ts->tree.local = local_ts_create(ts->rt_context);
diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c
index c3a9dc1ad6d..de109acc89a 100644
--- a/src/backend/access/heap/vacuumlazy.c
+++ b/src/backend/access/heap/vacuumlazy.c
@@ -2874,7 +2874,7 @@ dead_items_alloc(LVRelState *vacrel, int nworkers)
dead_items_info->num_items = 0;
vacrel->dead_items_info = dead_items_info;
- vacrel->dead_items = TidStoreCreateLocal(dead_items_info->max_bytes);
+ vacrel->dead_items = TidStoreCreateLocal(dead_items_info->max_bytes, true);
}
/*
@@ -2910,7 +2910,7 @@ dead_items_reset(LVRelState *vacrel)
/* Recreate the tidstore with the same max_bytes limitation */
TidStoreDestroy(dead_items);
- vacrel->dead_items = TidStoreCreateLocal(vacrel->dead_items_info->max_bytes);
+ vacrel->dead_items = TidStoreCreateLocal(vacrel->dead_items_info->max_bytes, true);
/* Reset the counter */
vacrel->dead_items_info->num_items = 0;