Re: SQL code runs slower as a stored function

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: S G <sgennaria2(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL code runs slower as a stored function
Date: 2010-05-13 16:05:54
Message-ID: 4BEC2362.2080104@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 13/05/2010 16:59, S G wrote:

> Can anyone lend a guess as to what I'm running into here, or do I need
> to provide more specifics to recreate the issue? It's repeatable, but
> it's a fair bit of data for me to just post in here as-is. I've already
> discovered a few creative workarounds (e.g. plpgsql: return query
> execute ...) that make it run faster again, but at this point, I'm
> really more interested in finding out what would make sql code run so
> much slower as a stored function in the first place.

It would help if you post the output from EXPLAIN ANALYZE for each case,
as this will hopefully show where the bottleneck is.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2010-05-13 16:06:45 Re: SQL code runs slower as a stored function
Previous Message S G 2010-05-13 15:59:37 SQL code runs slower as a stored function