Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c)
Date: 2024-01-13 14:36:11
Message-ID: CAEudQAqTNYDZ0RchO4-jHwQ0WkBAh9X0doS4VecGZ8MOt6T=hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em ter., 9 de jan. de 2024 às 06:31, John Naylor <johncnaylorls(at)gmail(dot)com>
escreveu:

> On Thu, Dec 28, 2023 at 7:58 PM Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
> > I think it would be more productive to initialize the entire array with
> -1, and avoid flagging, one by one, the items that should be -1.
>
> This just moves an operation from one place to the other, while
> obliterating the explanatory comment, so I don't see an advantage.
>
Well, I think that is precisely the case for using memset.
The way initialization is currently done is much slower and harmful to the
branch.
Of course, the gain should be small, but it is fully justified for
switching to memset.
Regarding the comment, once initialization is done via memset, such as
prstate.marked, it becomes irrelevant and unnecessary.

Best regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-01-13 14:37:31 Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx
Previous Message jian he 2024-01-13 14:19:35 Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)