Re: Regression in query optimizer when upgrading from 9.4.5 to 9.5.2? - Mailing list pgsql-general

From Tom Lane
Subject Re: Regression in query optimizer when upgrading from 9.4.5 to 9.5.2?
Date
Msg-id 28459.1466187471@sss.pgh.pa.us
Whole thread Raw
In response to Regression in query optimizer when upgrading from 9.4.5 to 9.5.2?  ("Erdmann, Markus @ Bellevue" <Markus.Erdmann@cbre.com>)
Responses Re: Regression in query optimizer when upgrading from 9.4.5 to 9.5.2?  ("Erdmann, Markus @ Bellevue" <Markus.Erdmann@cbre.com>)
List pgsql-general
"Erdmann, Markus @ Bellevue" <Markus.Erdmann@cbre.com> writes:
> We�re trying to debug a performance issue affecting our staging database, and we�ve narrowed it down to a difference
inthe query optimizer in 9.5.2. Upgrading to 9.5 is important for us because we need the ability to import foreign
schemas.

I think the core of the problem is the large rowcount estimation error
here:

>                           ->  Bitmap Index Scan on transactions_transaction_c69e55a4  (cost=0.00..18.02 rows=161
width=0)(actual time=20.153..20.153 rows=269021 loops=1) 
>                                 Index Cond: ((date_created >= '2010-01-01'::date) AND (date_created <=
'2015-12-31'::date))

That's a pretty simple condition and it's hard to believe that 9.5 does it
much differently than 9.4 did.  Perhaps you forgot to ANALYZE, or were
using a larger statistics target in the 9.4 installation?

            regards, tom lane


pgsql-general by date:

Previous
From: "Mike Sofen"
Date:
Subject: Re: PostgresSQL and HIPAA compliance
Next
From: Andy Colson
Date:
Subject: OT hardware recommend