Executing more than one function.

Поиск
Список
Период
Сортировка
От f vf
Тема Executing more than one function.
Дата
Msg-id CAA2T4CXFMaTQDP47KyWXajDQ_ifLwUWnYQq1_Nrt7Gvv=R+CHQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Executing more than one function.  (Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>)
Список pgsql-general
Hello,
I have a set of plsql functions that I want to execute. All these functions perform queries and insert data in the database and I need to execute them in order.
What I have noticed is that if I execute this script

BEGIN;
SELECT function1();
COMMIT;

BEGIN;
SELECT function2();
COMMIT;

BEGIN;
SELECT function3();
COMMIT;

it takes more time than if I execute one function at the time and sum the execution times of each one:

BEGIN;
SELECT functionX();
COMMIT;


In some cases if there are several millions of tuples in the database running all the rules in the same script takes 10 times more than running one at the time. 

Can anyone explain why this happens and how can I prevent it?

Thanks for the help. 

Filipe

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

Предыдущее
От: Raghavendra
Дата:
Сообщение: Re: Wal archiving and streaming replication
Следующее
От: Giuseppe Sacco
Дата:
Сообщение: Re: Executing more than one function.