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

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, 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-07 12:08:51
Message-ID: CALT9ZEGMOGWQuGON1z-Xx9FTS4RU05Jgf+qbL2CoPrQpqXEx6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ср, 7 апр. 2021 г. в 10:18, Bharath Rupireddy <
bharath(dot)rupireddyforpostgres(at)gmail(dot)com>:

> 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
> */
>
> With Regards,
> Bharath Rupireddy.
> EnterpriseDB: http://www.enterprisedb.com
>
>
>
I've investigated the commit, and I think there is just one more thing that
can make the page init more even. I propose my very small patch on this in
another discussion branch:
https://www.postgresql.org/message-id/CALT9ZEFFq2-n5Lmfg59L6Hm3ZrgCexyhR9eqme7v1jodtXGg1A@mail.gmail.com

If you want, feel free to discuss it and push if consider the change
relevant.

--
Best regards,
Pavel Borisov

Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2021-04-07 12:09:41 Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?
Previous Message Pavel Borisov 2021-04-07 12:02:18 [PATCH] Improve treatment of page special and page header alignment during page init.