Re: Query Performance Issue

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, neslişah demirci <neslisah(dot)demirci(at)gmail(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Query Performance Issue
Date: 2018-12-29 20:27:39
Message-ID: CAMkU=1y7gaK2=gZ5umOXKV=Zua=m90JEsEsfh6Ka0UABFHma9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sat, Dec 29, 2018 at 1:58 AM David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
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().
>
>
But "recommended_content_id" and "version" are both in the same table,
doesn't that make them base quals?

The most obvious thing to me would be to vacuum
product_content_recommendation_main2 to get rid of the massive number of
heap fetches. And to analyze everything to make sure the estimation errors
are not simply due to out-of-date stats. And to increase work_mem.

It isn't clear we want to get rid of the nested loop, from the info we have
to go on the hash join might be even slower yet. Seeing the plan with
enable_nestloop=off could help there.

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message David Rowley 2018-12-29 22:00:08 Re: Query Performance Issue
Previous Message Jim Finnerty 2018-12-29 20:11:16 Re: Gained %20 performance after disabling bitmapscan