public inbox for [email protected]
help / color / mirror / Atom feedFrom: Álvaro Herrera <[email protected]>
To: Andres Freund <[email protected]>
Cc: Fabrízio de Royes Mello <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: make ExecInsertIndexTuples arguments less bad
Date: Tue, 17 Feb 2026 19:00:12 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <szaipkumumw7bk4kbrjrkkcvk3rlf66lmlifvk2xgbm5gskkuw@3v72ynkya3ck>
On 2026-Feb-16, Andres Freund wrote:
> Personally I'd move the flags to before the slot and the estate before slot
> (because it seems like options should come before the data and the most
> frequently changing arguments should be later on), but that's an extremely
> minor detail.
Good point, I pushed like that.
> I'm mildly surprised about using bits32, we seem to be more widely just using
> uint32 or such. I find a lot of the typedefs in c.h much more noise than
> useful. But also, whatever.
Yeah, I dunno, maybe we can retire those, but to me they say more
explicitly that the variable is not a number but rather a set of bits.
It doesn't make any actual difference, of course ... I've tried to prod
others to use bits32 instead of uint32 and have had little (read: none)
uptake, hah.
> > There might be places in executor.h to reuse the f831d4accda0 thingy,
> > but this is probably not it.
>
> FWIW, when passing <= 6 values, passing the arguments by reference in a struct
> (rather than passing the struct by value), is likely to lead to less efficient
> code.
Noted.
> > @@ -943,11 +946,16 @@ ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
> > conflictindexes = resultRelInfo->ri_onConflictArbiterIndexes;
> >
> > if (resultRelInfo->ri_NumIndices > 0 && (update_indexes != TU_None))
> > + {
> > + bits32 flags = EIIT_IS_UPDATE;
> > +
> > + flags |= conflictindexes != NIL ? EIIT_NO_DUPE_ERROR : 0;
> > + flags |= update_indexes == TU_Summarizing ? EIIT_ONLY_SUMMARIZING : 0;
>
> I'd just make these ifs, this is somewhat hard to read.
Changed that way.
Thanks for reviewing!
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Los cuentos de hadas no dan al niño su primera idea sobre los monstruos.
Lo que le dan es su primera idea de la posible derrota del monstruo."
(G. K. Chesterton)
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: make ExecInsertIndexTuples arguments less bad
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox