Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0

From: tim_wilson <tim(dot)wilson(at)telogis(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0
Date: 2014-06-24 00:39:47
Message-ID: 1403570387738-5808509.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Huang, Suya 2014-06-24 07:07:37 Re: huge pgstat.stat file on PostgreSQL 8.3.24
Previous Message Pujol Mathieu 2014-06-23 07:20:39 GIST optimization to limit calls to operator on sub nodes