Re: Confirmation of bad query plan generated by 7.4 - Mailing list pgsql-performance

From Tom Lane
Subject Re: Confirmation of bad query plan generated by 7.4
Date
Msg-id 18843.1150251204@sss.pgh.pa.us
Whole thread Raw
In response to Re: Confirmation of bad query plan generated by 7.4  ("Shaun Thomas" <sthomas@leapfrogonline.com>)
List pgsql-performance
"Shaun Thomas" <sthomas@leapfrogonline.com> writes:
> I can see the planner not liking the results of a function,
> but a variable?  That's a static value!

Read what you wrote, and rethink...

If you're desperate you can construct a query string with the variable
value embedded as a literal, and then EXECUTE that.  This isn't a great
solution since it forces a re-plan on every execution.  We've
occasionally debated ways to do it better, but no such improvement will
ever appear in 7.4 ;-)

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Solaris shared_buffers anomaly?
Next
From: Tom Lane
Date:
Subject: Re: scaling up postgres