Re: SQL code runs slower as a stored function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: S G <sgennaria2(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: SQL code runs slower as a stored function
Date: 2010-05-13 19:19:31
Message-ID: 18588.1273778371@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * S G (sgennaria2(at)gmail(dot)com) wrote:
>> I guess to really get down to the issue, I'm curious if what I'm doing is
>> considered 'standard procedure' to others-- i.e. using funny workarounds
>> like building the query in a text var and executing it with plpgsql's RETURN
>> QUERY EXECUTE command.

> It's certainly not unusual when it's necessary. We do try to minimize
> the times it's necessary by making the planner as smart as possible.

Yeah. This is a known sore spot that I hope to do something about in
the 9.1 development cycle.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2010-05-13 19:37:12 Re: pg_dumpall for Postgres Database Daily Backup
Previous Message Tom Lane 2010-05-13 19:08:58 Re: Persistence problem