Re: Confirmation of bad query plan generated by 7.4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Shaun Thomas" <sthomas(at)leapfrogonline(dot)com>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Confirmation of bad query plan generated by 7.4
Date: 2006-06-14 02:13:24
Message-ID: 18843.1150251204@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Shaun Thomas" <sthomas(at)leapfrogonline(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2006-06-14 02:24:41 Re: scaling up postgres
Previous Message Tom Lane 2006-06-14 02:04:32 Re: Solaris shared_buffers anomaly?