Why is fncollation in FunctionCallInfoData rather than fmgr_info?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Why is fncollation in FunctionCallInfoData rather than fmgr_info?
Дата
Msg-id 20180605205747.5dewfi3oobk3sw3p@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?  (Chapman Flack <chap@anastigmatix.net>)
Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

In my understanding FunctionCallInfoData is basically per-call data,
whereas FmgrInfo is information about the function.  It makes some sense
that ->context is in FunctionCallInfoData, after all it's used for
per-row data like the trigger context.  But we don't really change the
collation of function invocations per-call.  Thus I don't quite get why
FunctionCallInfoData contains information about it rather than FmgrInfo.

Now I get that there's the practical reason that we want to pass the
collation to function invocations made with DirectionFunctionCall*Coll,
and they currently don't set up a FmgrInfo.  But that doesn't really
convince me this is a good idea.

The reason I'm asking is that I'm fixing the JIT code generation for
expressions to be more efficient. And for functions that do not get
inlined I currently need to set up a separate *per-call*
FunctionCallInfoData to allow the optimizer to be free enough to do it's
thing.  And the less metadata has to be copied around, the better.  I'm
not sure it's realistic to change this, I mostly want to understand the
reasoning.

Greetings,

Andres Freund


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

Предыдущее
От: Ashwin Agrawal
Дата:
Сообщение: Re: Recovery performance of DROP DATABASE with many tablespaces
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?