From: Cristian Prieto <cristian@clickdiario.com>
To: pgsql-performance@postgresql.org
Subject: Performance difference between sql and pgsql function...
Date: Wed, 2 Nov 2005 09:32:19 -0600
Message-ID: <007401c5dfc2$9d2c41e0$6500a8c0@gt.ClickDiario.local> (raw)
There any performance differences between a SQL function written in SQL
language or PL/psSQL language? For example:
Create or replace function sp_getfreq(
Var1 integer
) returns Boolean as
$$
Declare
Myval Boolean;
Begin
Select var1 in (select var3 from table1) into myval;
Return myval;
End;
$$
Language ‘plpgsql’ stable;
And with:
Create or replace function sp_getfreq(
Var1 integer
) returns boolean as
$$
Select $1 in (select var3 from table1);
$$
Language ‘sql’ stable;
I know the function is really simple, but in theory which of the three would
run faster?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: cristian@clickdiario.com
Subject: Re: Performance difference between sql and pgsql function...
In-Reply-To: <007401c5dfc2$9d2c41e0$6500a8c0@gt.ClickDiario.local>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox