Re: Explaining functions.

Поиск
Список
Период
Сортировка
От Hartman, Matthew
Тема Re: Explaining functions.
Дата
Msg-id 366642367C5B354197A1E0D27BC175BD0225976C@KGHMAIL.KGH.ON.CA
обсуждение исходный текст
Ответ на Re: Explaining functions.  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: Explaining functions.  ("Chris Spotts" <rfusca@gmail.com>)
Список pgsql-general
Heeeey the raise notice is a good idea, thanks. I use raise notice
already for other uses, may as well go with it. Thanks.


Matthew Hartman
Programmer/Analyst
Information Management, ICP
Kingston General Hospital
(613) 549-6666 x4294


-----Original Message-----
From: Merlin Moncure [mailto:mmoncure@gmail.com]
Sent: Tuesday, June 23, 2009 9:20 AM
To: Hartman, Matthew
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Explaining functions.

On Tue, Jun 23, 2009 at 8:03 AM, Hartman,
Matthew<Matthew.Hartman@krcc.on.ca> wrote:
> Is there a recommended approach when trying to use EXPLAIN on a
> function? Specifically, a function that is more than the typical
SELECT
> statement or tiny loop. The one in question that I'm hoping to
optimize
> is around 250 lines.

What I normally do for benchmarking of complex functions is to
sprinkle the source with "raise notice '%', timeofday();" to figure
out where the bottlenecks are.  Following that, I micro-optimize
problem queries or expressions outside of the function body in psql.

merlin


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Information about columns
Следующее
От: Jack Orenstein
Дата:
Сообщение: Re: Slight change in query leads to unexpected change in query plan