pl-pgsql "return set of..." "return next..." performance question

Поиск
Список
Период
Сортировка
От Gauthier, Dave
Тема pl-pgsql "return set of..." "return next..." performance question
Дата
Msg-id D7FF158337303A419CF4A183F48302D6035A2EE2@hdsmsx411.amr.corp.intel.com
обсуждение исходный текст
Ответы Re: pl-pgsql "return set of..." "return next..." performance question
Список pgsql-general

Hi:

 

I have  PL-PgSQL function that returns a set of records.  It builds up 2 temp tables and then queries them to generate the set of records to be returned a-la....

 

for rrec in

  select t1.x, t2.x from t1, t2 where....

loop

  return next rrec;

end loop;

 

 I noticed that it takes a long time to return the set of records. But if I run the same query at the psql cli, it runs blindingly fast.  So it appears that the process of returning the records via “return next” is the performance culprit.

 

Any ideas?

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

Предыдущее
От: Willem Buitendyk
Дата:
Сообщение: Re: Bulk Load Ignore/Skip Feature
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: pl-pgsql "return set of..." "return next..." performance question