Re: Prepared statements slow in 9.2 still (bad query plan)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Burbridge <Daniel(dot)Burbridge(at)publishingtechnology(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Prepared statements slow in 9.2 still (bad query plan)
Date: 2012-10-28 15:06:21
Message-ID: 12200.1351436781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Daniel Burbridge <Daniel(dot)Burbridge(at)publishingtechnology(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Karl Denninger 2012-10-28 15:15:45 Re: How to upgrade from 9.1 to 9.2 with replication?
Previous Message Віталій Тимчишин 2012-10-28 03:49:25 Re: Tons of free RAM. Can't make it go away.