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?



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to