pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Finnerty <jfinnert@amazon.com>
To: pgsql-performance@postgresql.org
Subject: Re: SELECT performance drop
Date: Wed, 23 Jan 2019 06:50:52 -0700 (MST)
Message-ID: <1548251452315-0.post@n3.nabble.com> (raw)
In-Reply-To: <CANxH4hF6HWrJTE41X77MeZ9U0wQd+Cc7JZwbrhbw=wSskggEAQ@mail.gmail.com>
References: <CANxH4hECtKo1+O38ZZ6cxVX3kua+n1rQz2FjSw-=f9U9g1c+Ow@mail.gmail.com>
	<CANxH4hF6HWrJTE41X77MeZ9U0wQd+Cc7JZwbrhbw=wSskggEAQ@mail.gmail.com>

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




view thread (10+ messages)  latest in thread

Message-ID: <1548251452315-0.post@n3.nabble.com>
Permalink:  ../1548251452315-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1548251452315-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jfinnert@amazon.com
  Subject: Re: SELECT performance drop
  In-Reply-To: <1548251452315-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox