Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZkfE-0000Ev-1v for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Jan 2018 21:45:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZkfD-0002nU-LC for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Jan 2018 21:45:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eZkfD-0002nL-FQ for pgsql-bugs@lists.postgresql.org; Thu, 11 Jan 2018 21:45:31 +0000 Received: from c.mail.sonic.net ([64.142.111.80]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eZkf9-0003K8-FB for pgsql-bugs@lists.postgresql.org; Thu, 11 Jan 2018 21:45:31 +0000 Received: from engels (162-236-13-58.lightspeed.sntcca.sbcglobal.net [162.236.13.58]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0BLjFSq000416 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 11 Jan 2018 13:45:15 -0800 Date: Thu, 11 Jan 2018 13:45:14 -0800 From: David Gould To: Tom Lane Cc: Alvaro Herrera , pgsql-bugs@lists.postgresql.org, Alina Alexeeva , Rajesh Bhatia , Arvind Kota , Jothikanth R , Ullas Lakkur Raghavendra , tomas.vondra@2ndquadrant.com Subject: Re: BUG #15005: ANALYZE can make pg_class.reltuples inaccurate. Message-ID: <20180111134514.5d018bd8@engels> In-Reply-To: <12173.1515683536@sss.pgh.pa.us> References: <20180111143922.evxiss5q2n4ug74a@alvherre.pgsql> <12173.1515683536@sss.pgh.pa.us> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbjXMxOAZNi+JNb0sNcVq/UGVFKGr+K47kNwBZK5PPLjTrl1U5F+HDFvZe4QiAD+gMV1tx6A3751xUozgJd/T55 X-Sonic-ID: C;HNFFtRj35xGCs9zi2dYaJA== M;5qRwtRj35xGCs9zi2dYaJA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 11 Jan 2018 10:12:16 -0500 Tom Lane wrote: > Alvaro Herrera writes: > > David Gould wrote: > >> I've tracked down how this happens and created a reproduction script and a > >> patch. Attached: > > > Great work. Please make sure to register this as a bug fix in the > > next commitfest. > > There's already an existing discussion about what seems to be the same > issue, or at least a closely related one: > > https://www.postgresql.org/message-id/flat/16db4468-edfa-830a-f921-39a50498e77e@2ndquadrant.com Yes. I reviewed that thread, while I was researching. It is a related issue but not the same. That one adds n_tup_dead to the reluples estimate after vacuums. It amplifies the effect of this one which prevents analyze from fixing reltuples. -dg -- David Gould daveg@sonic.net If simplicity worked, the world would be overrun with insects.