Re: overhead of plpgsql functions over simple select

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: overhead of plpgsql functions over simple select
Дата
Msg-id 162867790810232203j696e1b78gaa55158f94fdbef7@mail.gmail.com
обсуждение исходный текст
Ответ на Re: overhead of plpgsql functions over simple select  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: overhead of plpgsql functions over simple select  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
2008/10/24 Tom Lane <tgl@sss.pgh.pa.us>:
> "Pavel Stehule" <pavel.stehule@gmail.com> writes:
>> postgres=# create function simplefce(a int, b int) returns int as
>> $$select $1 + $2$$ language sql immutable strict;
>> CREATE FUNCTION
>> postgres=# create function simplefce1(a int, b int) returns int as
>> $$begin return a+b; end;$$ language plpgsql immutable strict;
>> CREATE FUNCTION
>
> That's a pretty unfair comparison, because that SQL function is simple
> enough to be inlined.  The place to use plpgsql is when you need some
> procedural logic; at which point a SQL function simply fails to provide
> the required functionality.
>

Yes, this test is maximal unfair to plpgsql - it's too simply
function. But it was original question. What is overhead plpgsql call
on simple functions? On every little bit complicated functions
overhead should be less. And this sample shows sense of using SQL
functions.

regards
Pavel Stehule

>                        regards, tom lane
>

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: overhead of plpgsql functions over simple select
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: overhead of plpgsql functions over simple select