Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0 - Mailing list pgsql-performance

From tim_wilson
Subject Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0
Date
Msg-id 1403570387738-5808509.post@n5.nabble.com
Whole thread Raw
In response to Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0  (tim_wilson <tim.wilson@telogis.com>)
List 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.


pgsql-performance by date:

Previous
From: Pujol Mathieu
Date:
Subject: GIST optimization to limit calls to operator on sub nodes
Next
From: "Huang, Suya"
Date:
Subject: Re: huge pgstat.stat file on PostgreSQL 8.3.24