Re: Explaining functions.

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: "Hartman, Matthew" <Matthew(dot)Hartman(at)krcc(dot)on(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Explaining functions.
Date: 2009-06-23 13:19:57
Message-ID: b42b73150906230619n8827613v94197cce18acc0d8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 23, 2009 at 8:03 AM, Hartman,
Matthew<Matthew(dot)Hartman(at)krcc(dot)on(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2009-06-23 13:26:56 Re: [BUGS] Integrity check
Previous Message Dave Page 2009-06-23 13:17:02 Re: [BUGS] Integrity check