Re: Prepared statements slow in 9.2 still (bad query plan) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Prepared statements slow in 9.2 still (bad query plan)
Date
Msg-id 12200.1351436781@sss.pgh.pa.us
Whole thread Raw
In response to Prepared statements slow in 9.2 still (bad query plan)  (Daniel Burbridge <Daniel.Burbridge@publishingtechnology.com>)
Responses Re: Prepared statements slow in 9.2 still (bad query plan)  (Shaun Thomas <sthomas@optionshouse.com>)
Re: Prepared statements slow in 9.2 still (bad query plan)  (Daniel Burbridge <Daniel.Burbridge@publishingtechnology.com>)
List pgsql-performance
Daniel Burbridge <Daniel.Burbridge@publishingtechnology.com> writes:
> I have a problem with prepared statements choosing a bad query plan - I was hoping that 9.2 would have eradicated the
problem:( 

9.2 will only pick the "right" plan if that plan's estimated cost is a
good bit cheaper than the "wrong" parameterized plan.  In this case,
not only is there not a lot of difference, but the difference is in the
wrong direction.  You need to fix that --- perhaps increasing stats
targets would help?

A more radical question is whether you have a well-chosen set of indexes
in the first place.  These two seem a bit odd, and certainly not
terribly well matched to this query.

            regards, tom lane


pgsql-performance by date:

Previous
From: delongboy
Date:
Subject: Re: How to upgrade from 9.1 to 9.2 with replication?
Next
From: Karl Denninger
Date:
Subject: Re: How to upgrade from 9.1 to 9.2 with replication?