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: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, 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-08 02:15:25
Message-ID: CALj2ACVQaWk89O+=C3HJmX1k-dDMmTm=SjdBSwL04_cVKQeFtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 7, 2021 at 11:47 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Wed, Apr 7, 2021 at 11:44 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> >
> > On Wed, Apr 07, 2021 at 06:31:19AM +0530, Bharath Rupireddy wrote:
> > > Setting p->pd_flags = 0; is unnecessary and redundant after memsetting
> > > the page to zeros. Also, see the existing code for pd_prune_xid,
> > > similarly I've done that for pd_flags. I think it's okay with /*
> > > p->pd_flags = 0; done by above MemSet */.
> >
> > Sure, but this one does not hurt much either as-is, so I have left it
> > out, and applied the rest.
>
> Thanks for pushing the patch.
>
> I wanted to comment out p->pd_flags = 0; in PageInit similar to the
> pd_prune_xid just for consistency.
> /* p->pd_prune_xid = InvalidTransactionId; done by above MemSet */

As I said above, just for consistency, I would like to see if the
attached one line patch can be taken, even though it doesn't have any
impact.

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

Attachment Content-Type Size
v1-0001-Remove-unnecessary-assignment-of-pd_flags-to-0-in.patch application/octet-stream 915 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-04-08 02:31:01 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Previous Message Amit Langote 2021-04-08 02:12:13 Re: ModifyTable overheads in generic plans