diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-04-07 14:35:26 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-04-07 14:35:26 +0900 |
commit | 4c0239cb7a7775e3183cb575e62703d71bf3302d (patch) | |
tree | 39bc8c4da4b6c03d7caadf9bf5922df8fddf11f3 /src/backend/access/gist/gistutil.c | |
parent | 9afffcb833d3c5e59a328a2af674fac7e7334fc1 (diff) | |
download | postgresql-4c0239cb7a7775e3183cb575e62703d71bf3302d.tar.gz |
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 'src/backend/access/gist/gistutil.c')
-rw-r--r-- | src/backend/access/gist/gistutil.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index 1ff1bf816f..8dcd53c457 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -761,8 +761,6 @@ gistinitpage(Page page, uint32 f) PageInit(page, pageSize, sizeof(GISTPageOpaqueData)); opaque = GistPageGetOpaque(page); - /* page was already zeroed by PageInit, so this is not needed: */ - /* memset(&(opaque->nsn), 0, sizeof(GistNSN)); */ opaque->rightlink = InvalidBlockNumber; opaque->flags = f; opaque->gist_page_id = GIST_PAGE_ID; |