Re: Explaining functions. - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Explaining functions.
Date
Msg-id b42b73150906230619n8827613v94197cce18acc0d8@mail.gmail.com
Whole thread Raw
In response to Explaining functions.  ("Hartman, Matthew" <Matthew.Hartman@krcc.on.ca>)
Responses Re: Explaining functions.
Re: Explaining functions.
List pgsql-general
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 by date:

Previous
From: Dave Page
Date:
Subject: Re: [BUGS] Integrity check
Next
From: David Fetter
Date:
Subject: Re: [BUGS] Integrity check