public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bruce Momjian <[email protected]>
To: David G. Johnston <[email protected]>
Cc: [email protected]
Cc: Pg Docs <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Re: incorrect information in documentation
Date: Mon, 9 Aug 2021 14:05:50 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwYQacXmG9zMcOgbBtGp-1QusGjXQBfMez9GcHpv=AX6SQ@mail.gmail.com>
References: <[email protected]>
	<CAKFQuwbHsQ14v3i4oEwPOmgEBqEFjG4i=WsuOMmP2q82myvdQQ@mail.gmail.com>
	<CAKFQuwYQacXmG9zMcOgbBtGp-1QusGjXQBfMez9GcHpv=AX6SQ@mail.gmail.com>

On Mon, Aug  9, 2021 at 09:20:53AM -0700, David G. Johnston wrote:
> On Mon, Aug 9, 2021 at 9:06 AM David G. Johnston <[email protected]>
> wrote:
> 
>     On Mon, Aug 9, 2021 at 8:02 AM PG Doc comments form <[email protected]
>     > wrote:
> 
>         Hello, on page
>         https://www.postgresql.org/docs/current/row-estimation-examples.html -
>         there
>         is a example:
>         selectivity = (1 - null_frac1) * (1 - null_frac2) * min(1/
>         num_distinct1,
>         1/num_distinct2)
>                     = (1 - 0) * (1 - 0) / max(10000, 10000)
>                     = 0.0001
>         in the first string  " * min" and in the second " / max"
>         as I understand it isn't correct.
> 
> 
>     Division is just multiplication by the reciprocal so while the presentation
>     here is inconsistent it is correct.  Likewise, the larger a number the
>     smaller its reciprocal, so the change from min to max also works.  
> 
> 
> 
> FWIW this used to be presented with the calculation and formula in sync, but
> the original had a simple typo in the calculation.  When the typo got fixed
> back in December of 2007 [1] the author of the patch simplified the calculation
> at the same time.  I suggest we update the formula line to match the
> calculation presented.

Nice, can you provide a patch please?

-- 
  Bruce Momjian  <[email protected]>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.






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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: incorrect information in documentation
  In-Reply-To: <[email protected]>

* 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