Re: inlining SQL functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: inlining SQL functions
Дата
Msg-id 28647.1270228367@sss.pgh.pa.us
обсуждение исходный текст
Ответ на inlining SQL functions  (Alexey Klyukin <alexk@commandprompt.com>)
Ответы Re: inlining SQL functions
Список pgsql-hackers
Alexey Klyukin <alexk@commandprompt.com> writes:
> Is there a reason why only a table free SQL functions are allowed to
> be inlined ?  I wonder why a simple SQL function containing only a
> SELECT * FROM table can't be expanded inline ?

If you're thinking of just replacing the call with a sub-SELECT
construct, that's no good in general because it would change the
semantics.  We can and do inline such things when the function
returns SETOF and is in the FROM list, but a regular scalar subselect
acts a bit differently than scalar SQL functions historically have.

Keep in mind also that there's not going to be a lot of benefit from
inlining other cases, since a subselect that's not in FROM is not
very optimizable.
        regards, tom lane


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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Alpha release this week?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Compile fail, alpha5 & gcc 4.3.3 in elog.c