From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Lewis <mlewis@entrata.com>
Cc: Philip Semanchuk <philip@americanefficient.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Understanding bad estimate (related to FKs?)
Date: Wed, 28 Oct 2020 20:13:43 -0500
Message-ID: <20201029011343.GO5380@telsasoft.com> (raw)
In-Reply-To: <CAHOFxGpcN+=Vo10=2roxOOm8UXu8zstdaggRq0vvu00wcC6YjQ@mail.gmail.com>
References: <7AC7104E-E233-4CCA-B99E-12197D61A4DD@americanefficient.com>
<20201026170405.GT9241@telsasoft.com>
<DF40D416-6F79-4912-9306-F012D0BED09A@americanefficient.com>
<CAHOFxGpcN+=Vo10=2roxOOm8UXu8zstdaggRq0vvu00wcC6YjQ@mail.gmail.com>
On Mon, Oct 26, 2020 at 11:20:01AM -0600, Michael Lewis wrote:
> On Mon, Oct 26, 2020 at 11:14 AM Philip Semanchuk <philip@americanefficient.com> wrote:
>
> > >> The item I'm focused on is node 23. The estimate is for 7 rows, actual
> > is 896 (multiplied by 1062 loops). I'm confused about two things in this
> > node.
> > >>
> > >> The first is Postgres' estimate. The condition for this index scan
> > contains three expressions --
> > >>
> > >> (five_uniform = zulu_five.five_uniform) AND
> > >> (whiskey_mike = juliet_india.whiskey_mike) AND
> > >> (bravo = 'mike'::text)
> >
>
> Are the columns correlated?
I guess it shouldn't matter, since the FKs should remove all but one of the
conditions.
Maybe you saw this other thread, which I tentatively think also affects your
case (equijoin with nonjoin condition)
https://www.postgresql.org/message-id/AM6PR02MB5287A0ADD936C1FA80973E72AB190%40AM6PR02MB5287.eurprd0...
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, mlewis@entrata.com, philip@americanefficient.com
Subject: Re: Understanding bad estimate (related to FKs?)
In-Reply-To: <20201029011343.GO5380@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox