Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WmbQd-0006yQ-4b for pgsql-performance@arkaria.postgresql.org; Tue, 20 May 2014 04:13:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WmbQc-0002jp-Jt for pgsql-performance@arkaria.postgresql.org; Tue, 20 May 2014 04:13:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WmbQb-0002jj-OE for pgsql-performance@postgresql.org; Tue, 20 May 2014 04:13:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WmbQZ-0000qM-W4 for pgsql-performance@postgresql.org; Tue, 20 May 2014 04:13:25 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s4K4DNNX031950; Tue, 20 May 2014 00:13:23 -0400 From: Tom Lane To: tim_wilson cc: pgsql-performance@postgresql.org Subject: Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0 In-reply-to: <1400459729388-5804416.post@n5.nabble.com> References: <1400459729388-5804416.post@n5.nabble.com> Comments: In-reply-to tim_wilson message dated "Sun, 18 May 2014 17:35:29 -0700" Date: Tue, 20 May 2014 00:13:22 -0400 Message-ID: <11299.1400559202@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org tim_wilson writes: > On a 9.3.1 server , I have a key busy_table in that is hit by most > transactions running on our system. One DB's copy of this table has 60K rows > and 1/3 of that tables rows can updated every minute. > Autovacuum autovacuum_analyze_scale_factor is set 0.02, so that analyse runs > nearly every minute. But when autovacuum vacuum runs I sometimes see the > following message in logs: > LOG: automatic vacuum of table "busy_table":* index scans: 0* > pages: 0 removed, 22152 remain > tuples: 0 removed, 196927 remain > buffer usage: 46241 hits, 478 misses, 715 dirtied > avg read rate: 0.561 MB/s, avg write rate: 0.839 MB/s > system usage: CPU 0.07s/0.06u sec elapsed 6.66 sec > and the tuples remaining is then overestimated by a factor >3 , and have > seen this over estimate as large at >20 times IE 5M FWIW, I tried to reproduce this without success. There's some code in there that attempts to extrapolate the total number of live tuples when VACUUM has not scanned the entire table. It's surely plausible that that logic went off the rails ... but without a test case or at least a more specific description of the problem scenario, it's hard to know what's wrong exactly. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance