Re: automatically generating node support functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: automatically generating node support functions
Дата
Msg-id 1201553.1657562258@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: automatically generating node support functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: automatically generating node support functions  (Robert Haas <robertmhaas@gmail.com>)
Re: automatically generating node support functions  (Andres Freund <andres@anarazel.de>)
Re: automatically generating node support functions  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
I wrote:
>> Andres Freund <andres@anarazel.de> writes:
>>> I was just rebasing meson ontop of this and was wondering whether the input
>>> filenames were in a particular order:

Pushed a patch to make that a bit less random-looking.

> +1 for sorting alphabetically.  I experimented with that and it's a
> really trivial change.

I had second thoughts about that, after noticing that alphabetizing
the NodeTag enum increased the backend's size by 20K or so.  Presumably
that's telling us that a bunch of switch statements got less dense,
which might possibly cause performance issues thanks to poorer cache
behavior or the like.  Maybe it's still appropriate to do, but it's
not as open-and-shut as I first thought.

More generally, I'm having second thoughts about the wisdom of
auto-generating the NodeTag enum at all.  With the current setup,
I am absolutely petrified about the risk of silent ABI breakage
thanks to the enum order changing.  In particular, if the meson
build fails to use the same input-file order as the makefile build,
then we will get different enum orders from the two builds, causing
an ABI discrepancy that nobody would notice until we had catastrophic
extension-compatibility issues in the field.

Of course, sorting the tags by name is a simple way to fix that.
But I'm not sure I want to buy into being forced to do it like that,
because of the switch-density question.

So at this point I'm rather attracted to the idea of reverting to
a manually-maintained NodeTag enum.  We know how to avoid ABI
breakage with that, and it's not exactly the most painful part
of adding a new node type.  Plus, that'd remove (most of?) the
need for gen_node_support.pl to deal with "node-tag-only" structs
at all.

Thoughts?

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: DropRelFileLocatorBuffers
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Eliminating SPI from RI triggers - take 2