Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?
Date: 2021-04-05 04:11:12
Message-ID: CALj2ACXttiCUrfFeBbdh15EkK4-LGkD0voqOyjPSrSnbak-YRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 3, 2021 at 3:09 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Mon, Mar 22, 2021 at 10:16 AM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > We are memset-ting the special space page that's already set to zeros
> > by PageInit in BloomInitPage, GinInitPage and SpGistInitPage. We have
> > already removed the memset after PageInit in gistinitpage (see the
> > comment there). Unless I'm missing something, IMO they are redundant.
> > I'm attaching a small patch that gets rid of the extra memset calls.
> >
> > While on it, I removed MAXALIGN(sizeof(SpGistPageOpaqueData)) in
> > SpGistInitPage because the PageInit will anyways align the
> > specialSize. This change is inline with other places (such as
> > BloomInitPage, brin_page_init GinInitPage, gistinitpage,
> > _hash_pageinit and so on) where we just pass the size of special space
> > data structure.
> >
> > I didn't see any regression test failure on my dev system with the
> > attached patch.
> >
> > Thoughts?
>
> The changes look fine to me.

Thanks!

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-04-05 04:19:03 Re: New Table Access Methods for Multi and Single Inserts
Previous Message Fujii Masao 2021-04-05 03:59:14 Re: Get memory contexts of an arbitrary backend process