Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c)
Date
Msg-id CAEudQAqTNYDZ0RchO4-jHwQ0WkBAh9X0doS4VecGZ8MOt6T=hw@mail.gmail.com
Whole thread Raw
In response to Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c)  (John Naylor <johncnaylorls@gmail.com>)
Responses Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c)
List pgsql-hackers
Em ter., 9 de jan. de 2024 às 06:31, John Naylor <johncnaylorls@gmail.com> escreveu:
On Thu, Dec 28, 2023 at 7:58 PM Ranier Vilela <ranier.vf@gmail.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

pgsql-hackers by date:

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