agora inbox for pgsql-performance@postgresql.org  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: neslişah demirci <neslisah.demirci@gmail.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query Performance Issue
Date: Sat, 29 Dec 2018 01:15:35 -0600
Message-ID: <20181229071535.GX30382@telsasoft.com> (raw)
In-Reply-To: <CAKJS1f8933Q2z7dugFcWoWSFAF3deKLMC=98QP_SXT_qPF3J9w@mail.gmail.com> <CABFxtPedz4zL+aPWut4+=um4av1aAXr6OVRfRB_6K7mJKMbEcw@mail.gmail.com>

On Thu, Dec 27, 2018 at 10:25:47PM +0300, neslişah demirci wrote:
> Have this explain analyze output :
> 
> *https://explain.depesz.com/s/Pra8a <https://explain.depesz.com/s/Pra8a>*

On Sat, Dec 29, 2018 at 07:58:28PM +1300, David Rowley wrote:
> On Sat, 29 Dec 2018 at 04:32, Justin Pryzby <pryzby@telsasoft.com> wrote:
> > I think the solution is to upgrade (at least) to PG10 and CREATE STATISTICS
> > (dependencies).
> 
> Unfortunately, I don't think that'll help this situation. Extended
> statistics are currently only handled for base quals, not join quals.
> See dependency_is_compatible_clause().

Right, understand.

Corrrect me if I'm wrong though, but I think the first major misestimate is in
the scan, not the join:

|Index Scan using product_content_recommendation_main2_recommended_content_id_idx on product_content_recommendation_main2 prm (cost=0.57..2,031.03 rows=345 width=8) (actual time=0.098..68.314 rows=3,347 loops=1)
|Index Cond: (recommended_content_id = 3371132)
|Filter: (version = 1)
|Rows Removed by Filter: 2708

Justin




view thread (57+ messages)  latest in thread

Message-ID: <20181229071535.GX30382@telsasoft.com>
Permalink:  ../20181229071535.GX30382@telsasoft.com/
Also on:    postgresql.org/message-id/20181229071535.GX30382@telsasoft.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: pryzby@telsasoft.com, neslisah.demirci@gmail.com, david.rowley@2ndquadrant.com
  Subject: Re: Query Performance Issue
  In-Reply-To: <20181229071535.GX30382@telsasoft.com>

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

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