Re: make ExecInsertIndexTuples arguments less bad - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: make ExecInsertIndexTuples arguments less bad
Date
Msg-id 202602161805.jwp2f4s5svmp@alvherre.pgsql
Whole thread Raw
In response to Re: make ExecInsertIndexTuples arguments less bad  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: make ExecInsertIndexTuples arguments less bad
List pgsql-hackers
Hello Fabrízio, hackers,

On 2026-Feb-11, Fabrízio de Royes Mello wrote:

> On Wed, Feb 11, 2026 at 4:07 PM Álvaro Herrera <alvherre@kurilemu.de> wrote:
> 
> > The arguments to ExecInsertIndexTuples() are rather unhelpful to read;
> > patching them is messy and hard to follow.  How about we reuse the
> > pattern we used in commit f831d4accda0 to make them less bad?
> > I think the code is much nicer to read this way.
>
> Much better. LGTM!

Thanks for looking!  However, I had second thoughts about this
formulation.  Mainly, the fact that one of the output arguments is part
of the macro is kinda icky.  So I decided that a simpler, less
innovative option is to just use a bits32 argument to carry the input
booleans, and let the output boolean be a separate argument (which I
also moved to appear last in the argument list, as we normally do).
This also means the list of indexes continues to be its own argument.
But, as I said, this is less innovative, which I think is mostly good.
And it definitely reads better than currently.

There might be places in executor.h to reuse the f831d4accda0 thingy,
but this is probably not it.

Thanks,

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Los dioses no protegen a los insensatos.  Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Next
From: Alvaro Herrera
Date:
Subject: Re: pgstat include expansion