pgsql: Remove redundant memset(0) calls for page init of some index AMs

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove redundant memset(0) calls for page init of some index AMs
Date: 2021-04-07 05:36:26
Message-ID: E1lU0ra-0004Sq-He@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4c0239cb7a7775e3183cb575e62703d71bf3302d

Modified Files
--------------
contrib/bloom/blinsert.c | 1 -
contrib/bloom/blutils.c | 1 -
src/backend/access/gin/ginutil.c | 1 -
src/backend/access/gist/gistutil.c | 2 --
src/backend/access/spgist/spgutils.c | 3 +--
5 files changed, 1 insertion(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2021-04-07 05:46:08 pgsql: Message improvement
Previous Message Michael Paquier 2021-04-07 04:48:28 Re: pgsql: Add some information about authenticated identity via log_connec