Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edtNn-0004Sy-1T for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Jan 2018 07:52:39 +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 1edtNm-0002qO-8y for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Jan 2018 07:52:38 +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.84_2) (envelope-from ) id 1edtNm-0002q9-0G for pgsql-bugs@lists.postgresql.org; Tue, 23 Jan 2018 07:52:38 +0000 Received: from c.mail.sonic.net ([64.142.111.80]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1edtNj-0006Tu-3v for pgsql-bugs@lists.postgresql.org; Tue, 23 Jan 2018 07:52:36 +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 w0N7qOfU008050 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 22 Jan 2018 23:52:24 -0800 Date: Mon, 22 Jan 2018 23:52:24 -0800 From: David Gould To: Alvaro Herrera Cc: pgsql-bugs@lists.postgresql.org, Alina Alexeeva , Rajesh Bhatia , Arvind Kota , Jothikanth R , Ullas Lakkur Raghavendra Subject: Re: BUG #15005: ANALYZE can make pg_class.reltuples inaccurate. Message-ID: <20180122235224.22bf654d@engels> In-Reply-To: <20180111143922.evxiss5q2n4ug74a@alvherre.pgsql> References: <20180111041757.7858c2ae@engels> <20180111143922.evxiss5q2n4ug74a@alvherre.pgsql> 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: UmFuZG9tSVb9jIiIWwQ8PnC5byY0orR2f7+TuQMAgmCB5JTNBEWSFic2HvJyyZ2hXgrSotQ0Z+IfZ2UsQSRT67Yigy42VbzU X-Sonic-ID: C;3raIWRIA6BGXcdzi2dYaJA== M;mDW0WRIA6BGXcdzi2dYaJA== 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 11:39:22 -0300 Alvaro Herrera wrote: > David Gould wrote: > > > I've tracked down how this happens and created a reproduction script and a > > patch. Attached: > > > > - vac_estimate_reltuples.patch Patch against master > > - README.txt Instructions for testing > > - reltuples_analyze_bug.sql Reproduction script > > - analyze_counts.awk Helper for viewing results of test > > - test_standard.txt Test output for unpatched postgresql 10.1 > > - test_patched.txt Test output with patch > > Great work. Please make sure to register this as a bug fix in the > next commitfest. > Done last week. See: https://www.postgresql.org/message-id/flat/20180117164916.3fdcf2e9@engels/ I think this should be considered for back-patching, the bug exists in all versions back to 9.4 (and probably earlier, but I did not test those). -dg -- David Gould daveg@sonic.net If simplicity worked, the world would be overrun with insects.