Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mD7nS-0004F8-Bp for pgsql-docs@arkaria.postgresql.org; Mon, 09 Aug 2021 16:06:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mD7nR-0003MP-6q for pgsql-docs@arkaria.postgresql.org; Mon, 09 Aug 2021 16:06:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mD7nQ-0003M7-UH for pgsql-docs@lists.postgresql.org; Mon, 09 Aug 2021 16:06:37 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mD7nO-0001CX-Of for pgsql-docs@lists.postgresql.org; Mon, 09 Aug 2021 16:06:35 +0000 Received: by mail-pl1-x62a.google.com with SMTP id e19so3362210pla.10 for ; Mon, 09 Aug 2021 09:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=OUdzRvcXkNnzzDd/KhvQs71lV42o1Ji/bS3vgyMZw3Q=; b=R+w9cWc6ETBX/YyX3Q/wFDuDOQtR7Xs+6OFCH3H/t5ZzYWKUFMPn6eaFfGfTDp4l+R CscNSBz4Mzdba9UxrpN/4Bt1gaY8fdbVR4jplknjC59rQXo5UdcYbYy9bO/tKM1KLrHJ U3ov5/vYFi4jEoKZPYc+ge3H/nAzIYOZRHCNAkJHqwhq8b93r12NyxhMMhPfXW1OEuRH SD/LLt9YC5OoC1KCBta6Hh6yZXIlQ8/uvAw5ioQfWuadfmDNEL0EZSeFYyIXjAU+booZ uML0oEgUGfKxD3oXQGynH0XQj6Q1A4nTgU6jUWXV3gY2n/6vAWOLJZTYu2ZGGKdVfxDh 1aPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=OUdzRvcXkNnzzDd/KhvQs71lV42o1Ji/bS3vgyMZw3Q=; b=qDaOGqHtdxsmqLgAcNhg7H8MZoM3JbMASwKgun8UUtF/RnveR5Ik8plhsWTzPH2BGV nWISWr8o3BqxFu2U2gj5vm63dERjcpLPFuu6InDcSu1MKtx6aZ7QvyxK7X+iI4qRQ1xj z1302fb6qblrgXlMDMmb8DPrc1olySOqL7FDFqpM9fjfs92G2dZxppgU5WKclbLRR0fl dPCnSDCTnP9oxFpr+yFAf/oorhX6PcU4M6JOSlDrfi41sF5sfboKLSYmiG3NQy+JSxf2 R2Sl+zFlnegQk1z+tPbRxETgpb1E+j3e5+AWj/tJOD02qvKRzZpTkJvKJq7XZLYWDxrN AzMw== X-Gm-Message-State: AOAM530EQaI96C7slZs7zd2n5Sbs697VupQby9UNQGcNywUhRH9qMRI5 Od+U+SgLglNhAqfb5t2a0m9lNxNsHlsuwxLzoGU= X-Google-Smtp-Source: ABdhPJwaD7vamVeBLPqGKMz8chvVhBs466H4z8wFbW1/EbXp9Z0xg+4AS8/OHGSI66ek9mK5Yz0N9ngs7F5t9RVIW4w= X-Received: by 2002:a17:902:a9c6:b029:12d:328b:a467 with SMTP id b6-20020a170902a9c6b029012d328ba467mr3319455plr.32.1628525193431; Mon, 09 Aug 2021 09:06:33 -0700 (PDT) MIME-Version: 1.0 References: <162851358008.709.11763395628268716122@wrigleys.postgresql.org> In-Reply-To: <162851358008.709.11763395628268716122@wrigleys.postgresql.org> From: "David G. Johnston" Date: Mon, 9 Aug 2021 09:06:16 -0700 Message-ID: Subject: Re: incorrect information in documentation To: ivanmulhin@gmail.com, Pg Docs Content-Type: multipart/alternative; boundary="000000000000a98def05c9229175" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a98def05c9229175 Content-Type: text/plain; charset="UTF-8" On Mon, Aug 9, 2021 at 8:02 AM PG Doc comments form 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. David J. --000000000000a98def05c9229175 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Aug 9, 2021 at 8:02 AM PG Doc comments form <noreply@postgresql.org> wrot= e:
Hello, on page
https://www.postgresql.org/docs/= current/row-estimation-examples.html - there
is a example:
selectivity =3D (1 - null_frac1) * (1 - null_frac2) * min(1/num_distinct1,<= br> 1/num_distinct2)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D (1 - 0) * (1 - 0) / max(10000= , 10000)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 0.0001
in the first string=C2=A0 " * min" and in the second " / max= "
as I understand it isn't correct.

Div= ision is just multiplication by the reciprocal so while the presentation he= re is inconsistent it is correct.=C2=A0 Likewise, the larger a number the s= maller its reciprocal, so the change from min to max also works.=C2=A0=C2= =A0

David J.

--000000000000a98def05c9229175--