Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn62X-0001UP-0M for pgsql-docs@arkaria.postgresql.org; Tue, 07 Aug 2018 17:45:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fn62V-000071-6Y for pgsql-docs@arkaria.postgresql.org; Tue, 07 Aug 2018 17:44:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn62U-00006u-To for pgsql-docs@lists.postgresql.org; Tue, 07 Aug 2018 17:44:59 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fn62S-0002hW-1a for pgsql-docs@lists.postgresql.org; Tue, 07 Aug 2018 17:44:57 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1fn62R-0004GH-1V; Tue, 07 Aug 2018 13:44:55 -0400 Date: Tue, 7 Aug 2018 13:44:55 -0400 From: Bruce Momjian To: madhav@cockroachlabs.com, pgsql-docs@lists.postgresql.org Subject: Re: Multivariate statistics Message-ID: <20180807174455.GE7297@momjian.us> References: <153123827277.1406.2599036349134002521@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153123827277.1406.2599036349134002521@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jul 10, 2018 at 03:57:52PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/10/static/multivariate-statistics-examples.html > Description: > > Hi All, > > I'm a little confused by the documentation here: > https://www.postgresql.org/docs/10/static/multivariate-statistics-examples.html. > > > In particular, the selectivity of the second query doesn't seem to match up > with what is expected in the notes. I feel like I may be missing something? > > > (I am referring to the output of this explain command: EXPLAIN (ANALYZE, > TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;) Uh, the first query shows an _estimate_ of rows=1, which does not match the actual rows=100: Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1) The second query has it right: Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1) -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +