Search Postgresql Archives

Re: overhead of plpgsql functions over simple select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Pavel Stehule" <pavel.stehule@xxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux