summaryrefslogtreecommitdiff
path: root/contrib/bloom
diff options
context:
space:
mode:
authorMichael Paquier2021-04-07 05:35:26 +0000
committerMichael Paquier2021-04-07 05:35:26 +0000
commit4c0239cb7a7775e3183cb575e62703d71bf3302d (patch)
tree39bc8c4da4b6c03d7caadf9bf5922df8fddf11f3 /contrib/bloom
parent9afffcb833d3c5e59a328a2af674fac7e7334fc1 (diff)
Remove redundant memset(0) calls for page init of some index AMs
Bloom, GIN, GiST and SP-GiST rely on PageInit() to initialize the contents of a page, and this routine fills entirely a page with zeros for a size of BLCKSZ, including the special space. Those index AMs have been using an extra memset() call to fill with zeros the special page space, or even the whole page, which is not necessary as PageInit() already does this work, so let's remove them. GiST was not doing this extra call, but has commented out a system call that did so since 6236991. While on it, remove one MAXALIGN() for SP-GiST as PageInit() takes care of that. This makes the whole page initialization logic more consistent across all index AMs. Author: Bharath Rupireddy Reviewed-by: Vignesh C, Mahendra Singh Thalor Discussion: https://postgr.es/m/CALj2ACViOo2qyaPT7krWm4LRyRTw9kOXt+g6PfNmYuGA=YHj9A@mail.gmail.com
Diffstat (limited to 'contrib/bloom')
-rw-r--r--contrib/bloom/blinsert.c1
-rw-r--r--contrib/bloom/blutils.c1
2 files changed, 0 insertions, 2 deletions
diff --git a/contrib/bloom/blinsert.c b/contrib/bloom/blinsert.c
index d37ceef753a..c34a640d1c4 100644
--- a/contrib/bloom/blinsert.c
+++ b/contrib/bloom/blinsert.c
@@ -63,7 +63,6 @@ flushCachedPage(Relation index, BloomBuildState *buildstate)
static void
initCachedPage(BloomBuildState *buildstate)
{
- memset(buildstate->data.data, 0, BLCKSZ);
BloomInitPage(buildstate->data.data, 0);
buildstate->count = 0;
}
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c
index 1e505b1da54..754de008d43 100644
--- a/contrib/bloom/blutils.c
+++ b/contrib/bloom/blutils.c
@@ -411,7 +411,6 @@ BloomInitPage(Page page, uint16 flags)
PageInit(page, BLCKSZ, sizeof(BloomPageOpaqueData));
opaque = BloomPageGetOpaque(page);
- memset(opaque, 0, sizeof(BloomPageOpaqueData));
opaque->flags = flags;
opaque->bloom_page_id = BLOOM_PAGE_ID;
}