SPs performance...

Поиск
Список
Период
Сортировка
От Cristian Prieto
Тема SPs performance...
Дата
Msg-id 002401c5aa69$ca411cc0$6500a8c0@gt.ClickDiario.local
обсуждение исходный текст
Список pgsql-general
I need to fine tuning my postgresql for performance, I depend a lot in a couple and few SPs to made a sort of kind of tasks, the most of those pgsql sps are made in pl/pgsql, most of them are simple:
 
create or replace function sp_one(id integer)
returns setof table1 as
$$
declare
    var table1%rowtype;
begin
    for var in (select * from table1 where myid=id) loop
        return next var;
    end loop;
    return;
end;
$$
language 'plpgsql' stable;
 
I think this simple sp would be so much easy as
 
create or replace function sp_one(id integer)
returns setof table1 as
$$
    select * from table1 where myid=$1;
$$
language 'sql' stable;
 
I guess it sounds more simple but I don't know if it add performance issues in a language or in a simple "inline" sql declarartion...
 
There are a few more sps a little more complex, mainly in pl/pgsql but I don't know that if I write them in C language it would add more speed to the execution of the code (most of them made a couple of queries)...
 
Any help?
 
Thanks a lot!

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: postgresql performance degradation over time....
Следующее
От: Matt Miller
Дата:
Сообщение: Re: Postgresql replication