Re: Query Performance Issue

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: neslişah demirci <neslisah(dot)demirci(at)gmail(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Performance Issue
Date: 2018-12-29 07:15:35
Message-ID: 20181229071535.GX30382@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)telsasoft(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jim Finnerty 2018-12-29 12:00:05 Re: Query Performance Issue
Previous Message David Rowley 2018-12-29 06:58:28 Re: Query Performance Issue