Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WzEmD-0004Mh-Rp for pgsql-performance@arkaria.postgresql.org; Tue, 24 Jun 2014 00:39:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WzEmD-0006h7-6P for pgsql-performance@arkaria.postgresql.org; Tue, 24 Jun 2014 00:39:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WzEmC-0006h0-39 for pgsql-performance@postgresql.org; Tue, 24 Jun 2014 00:39:56 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1WzEm7-00008i-30 for pgsql-performance@postgresql.org; Tue, 24 Jun 2014 00:39:54 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WzEm3-00024j-O3 for pgsql-performance@postgresql.org; Mon, 23 Jun 2014 17:39:47 -0700 Date: Mon, 23 Jun 2014 17:39:47 -0700 (PDT) From: tim_wilson To: pgsql-performance@postgresql.org Message-ID: <1403570387738-5808509.post@n5.nabble.com> In-Reply-To: <1402440085834-5806747.post@n5.nabble.com> References: <1400459729388-5804416.post@n5.nabble.com> <11299.1400559202@sss.pgh.pa.us> <1402016119875-5806283.post@n5.nabble.com> <1402037012706-5806302.post@n5.nabble.com> <1402053752755-5806320.post@n5.nabble.com> <1402436240210-5806743.post@n5.nabble.com> <6448.1402438054@sss.pgh.pa.us> <1402440085834-5806747.post@n5.nabble.com> Subject: Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) 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 Have been looking at lazyvacuum.c trying to think of a way of changing the calculation of the stats to ensure that my hot table stats do not get so badly distorted. What I have noticed is that when I reindex my hot table the stats on the table do not seem to change in pg_stat_user_tables (ie they stay bad) but the EXPLAIN for the query starts using the correct index again. The index itself does not seem very bloated but reindex seems to alter the query optimizer choices. I can't see in index.c where side effect would be caused. Why is this? Not sure if this is entirely helpful as reindex takes exclusive lock, but if I used a concurrent rebuild and rename of the index I might be able to work around this. -- View this message in context: http://postgresql.1045698.n5.nabble.com/autovacuum-vacuum-creates-bad-statistics-for-planner-when-it-log-index-scans-0-tp5804416p5808509.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance