Re: function taking a long time. any options o speed it up.

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Rhys Stewart <rhys(dot)stewart(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: function taking a long time. any options o speed it up.
Date: 2006-07-18 20:09:48
Message-ID: 20060718200948.GA43238@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 18, 2006 at 08:11:40AM -0500, Rhys Stewart wrote:
> i created a function and it takes a long time to run. I was testing it
> as a wrote it and to the first drop table it takes just short of a
> second. however when the rest of the code is added on, it takes
> upwards of 5 minutes. Not the most appropriate thing. Are there any
> tips out there for making functions go faster?

Find out what parts of the function are slow. Have you used RAISE
to display the function's progress? Have you executed any of the
queries by hand to see how fast they run? Have you used EXPLAIN
ANALYZE to see if you could benefit from rewriting a query, adding
indexes, or tuning configuration settings?

The UPDATE statement with the ORs and regular expression matches
looks like it might be slow. Is it?

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reid Thompson 2006-07-18 20:26:20 postmaster: StreamConnection: accept: No such device or address
Previous Message Merlin Moncure 2006-07-18 19:39:34 Re: Performance problem with query