pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove redundant memset(0) calls for page init of some index AMs
Date: Wed, 07 Apr 2021 05:36:26 +0000
Message-ID: <E1lU0ra-0004Sq-He@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1lU0ra-0004Sq-He@gemulon.postgresql.org>
Permalink:  ../E1lU0ra-0004Sq-He@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lU0ra-0004Sq-He@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Remove redundant memset(0) calls for page init of some index AMs
  In-Reply-To: <E1lU0ra-0004Sq-He@gemulon.postgresql.org>
  References: <E1lU0ra-0004Sq-He@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox