Re: Changing SQL Inlining Behaviour (or...?)

Поиск
Список
Период
Сортировка
От Adam Brightwell
Тема Re: Changing SQL Inlining Behaviour (or...?)
Дата
Msg-id CAE_9P=iUB9tJBmHefSW-bM4-qtJWD1yCKmC0QJ-gsdJLxQp0+A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Changing SQL Inlining Behaviour (or...?)  (Paul Ramsey <pramsey@cleverelephant.ca>)
Список pgsql-hackers
>> > * Solution #2 - Quick and dirty and invisible. Tom suggested a hack that achieves the aims of #1 but without
addingsyntax to CREATE FUNCTION: have the inlining logic look at the cost of the wrapper and the cost of parameters,
andif the cost of the wrapper "greatly exceeded" the cost of the parameters, then inline. So the PostGIS project would
justset the cost of our wrappers very high, and we'd get the behaviour we want, while other users who want to use
wrappersto force caching of calculations would have zero coded wrapper functions.  Pros: Solves the problem and easy to
implement,I'm happy to contribute. Cons: it's so clearly a hack involving hidden (from users) magic. 
>> > ...
>> > So my question to hackers is: which is less worse, #1 or #2, to implement and submit to commitfest, in case #3
doesnot materialize in time for PgSQL 12? 
>>
>> I've been working with Paul to create and test a patch (attached) that
>> addresses Solution #2. This patch essentially modifies the inlining
>> logic to compare the cost of the function with the total cost of the
>> parameters. The goal as stated above, is that for these kinds of
>> functions, they would be assigned relatively high cost to trigger the
>> inlining case.
>
>
> I've tested this patch for both the internal types case and for the PostGIS functions case, and in both cases it
providesa way to get around the undesirable inlining behaviour for our case without impacting people for whom the
behaviourhas been desirable in the past. 
>
> Is this already in the commitfest?

Yes.

https://commitfest.postgresql.org/21/1965/

-Adam


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

Предыдущее
От: Jesper Pedersen
Дата:
Сообщение: Re: partitioned tables referenced by FKs
Следующее
От: John Naylor
Дата:
Сообщение: Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)