Re: SELECT performance drop - Mailing list pgsql-performance

From Jim Finnerty
Subject Re: SELECT performance drop
Date
Msg-id 1548251452315-0.post@n3.nabble.com
Whole thread Raw
In response to Re: SELECT performance drop  (Jan Nielsen <jan.sture.nielsen@gmail.com>)
Responses Re: SELECT performance drop  (Jan Nielsen <jan.sture.nielsen@gmail.com>)
List pgsql-performance
One thing that isn't helping is that you have a redundant predicate.  The
selectivity of this predicate is also estimated too low, so removing the
redundant predicate might improve the estimate and change the plan:

(                                                 "
         + "         o.consumer IS NULL                                "
         + "    ) OR (                                                 "
         + "         o.consumer IS NOT NULL                            "
         + "     AND o.consumer > 0  

remove "o.consumer IS NOT NULL AND", which is implied by o.consumer > 0. 
This predicate should have been automatically removed, but the filter shown
in depesz shows that it was not.

If you can find out what the faster plan was, that would be helpful to know.



-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html


pgsql-performance by date:

Previous
From: Jan Nielsen
Date:
Subject: Re: SELECT performance drop
Next
From: Mariel Cherkassky
Date:
Subject: ERROR: found xmin from before relfrozenxid