Tuning queries inside a function

Поиск
Список
Период
Сортировка
От Mike Nolan
Тема Tuning queries inside a function
Дата
Msg-id 200504291732.j3THWRcj002464@gw.tssi.com
обсуждение исходный текст
Ответы Re: Tuning queries inside a function  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Re: Tuning queries inside a function  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Список pgsql-general
What's the best way to tune the queries inside a user function?

I have a fairly complicated function that may make as many as 10 queries
on several tables, some of which involve multiple joins.

Further, in the PHP program that needs this function, it can be called
as many as 400,000 times.  The last time I ran the program in production
mode, it took 35 hours to complete!  Since then I've done some reworking
to avoid the function calls about half of the time, that cut the run time
down to about 16 hours, but that's still longer than I'd like.

I need to find out if the function can be tuned further, but 'explain'
doesn't really tell much about what's happening inside the function.

Any ideas on how to tune a user function?
--
Mike Nolan

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Increasing statistics results in worse estimates
Следующее
От: raptor
Дата:
Сообщение: win-1251 cyrillic support ?