Re: Function performance degrades after repeated execution

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Function performance degrades after repeated execution
Дата
Msg-id 7f0d6a8b-bf7e-a2bb-a248-62239c67fee8@gmail.com
обсуждение исходный текст
Ответ на Function performance degrades after repeated execution  (Dave Roberge <droberge@bluetarp.com>)
Ответы Re: Function performance degrades after repeated execution
Список pgsql-general
On 11/16/19 8:22 AM, Dave Roberge wrote:
> Hi,
>
> We've been troubleshooting a slow running function in our postgres database. I've been able to boil it down to the
simplestfunction possible. It looks like this:
 
>
> FOR rec IN select 1 as matchval FROM table1 t1, table2 t2
>    join table3 t3 on t3.col = t2.col
>    WHERE t1.col = id
> LOOP
>    IF rec.matchval > 0 THEN
>      co := co + 1;
>    END IF;
>    if co % 100 = 0 then
>      raise notice 'match value %', co;
>    end if;
> END LOOP;

Where are you joining table1 to either table2 or table3?

-- 
Angular momentum makes the world go 'round.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: access to original-statement predicates in an INSTEAD-OF row trigger
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Function performance degrades after repeated execution