Re: overhead of plpgsql functions over simple select

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: overhead of plpgsql functions over simple select
Дата
Msg-id 18918.1224823582@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: overhead of plpgsql functions over simple select  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Ответы Re: overhead of plpgsql functions over simple select  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-general
"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.

            regards, tom lane

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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: overhead of plpgsql functions over simple select
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: overhead of plpgsql functions over simple select