pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Virendra Kumar <viru_7683@yahoo.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: Wrong PostgreSQL Plan
Date: Wed, 6 May 2020 01:41:11 +0000 (UTC)
Message-ID: <261047451.1963400.1588729271431@mail.yahoo.com> (raw)
In-Reply-To: <CAKFQuwZr7XZTB8mjPNKgegf_goPZ1PTJdRD5YThSRMoLjSyd=w@mail.gmail.com>
References: <484413316.1946041.1588727721718.ref@mail.yahoo.com>
	<484413316.1946041.1588727721718@mail.yahoo.com>
	<CAKFQuwZr7XZTB8mjPNKgegf_goPZ1PTJdRD5YThSRMoLjSyd=w@mail.gmail.com>

Hi David,
Thank you for your reply!
You mean when you change the date equality filter to a more recent date? - This is correct we have faced this when we change equality filter to more recent date.

Will be sending explain analyze on the thread when I get that.

We ran analyze many time to see if that resolves but looks like it is not buzzing. Also for regular analyze we don't run manually, they are all left to autoanalyze process.

Regards,Virendra

    On Tuesday, May 5, 2020, 6:34:37 PM PDT, David G. Johnston <david.g.johnston@gmail.com> wrote:  
 
 On Tue, May 5, 2020 at 6:15 PM Virendra Kumar <viru_7683@yahoo.com> wrote:

Optimizer is behaving little weird in the sense that for change in one filter


You mean when you change the date equality filter to a more recent date? 
 it is using NESTED LOOP JOIN and running for over 30 seconds whereas for other filter is working fine using HASH JOIN and under mili seconds.

Which means it runs to completion which means EXPLAIN ANALYZE is possible and considerably more helpful.

We have played little bit around default_statistics_target, sometimes it worked when the setting is around 1500 other times it doesn't work even with setting as high as 5000. Is there anything community can suggest us in resolving this?

Given that adding more data causes the good plan to stop working I would have to say that increasing how often you run ANALYZE on the table, irrespective of default_statistics_target, is probably a good thing to try.
David J.
  

view thread (3+ messages)

Message-ID: <261047451.1963400.1588729271431@mail.yahoo.com>
Permalink:  ../261047451.1963400.1588729271431@mail.yahoo.com/
Also on:    postgresql.org/message-id/261047451.1963400.1588729271431@mail.yahoo.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: viru_7683@yahoo.com, david.g.johnston@gmail.com
  Subject: Re: Wrong PostgreSQL Plan
  In-Reply-To: <261047451.1963400.1588729271431@mail.yahoo.com>
  References: <484413316.1946041.1588727721718.ref@mail.yahoo.com> <484413316.1946041.1588727721718@mail.yahoo.com> <CAKFQuwZr7XZTB8mjPNKgegf_goPZ1PTJdRD5YThSRMoLjSyd=w@mail.gmail.com> <261047451.1963400.1588729271431@mail.yahoo.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