When was ANALYZE run in the past? - Mailing list pgsql-general

From Benjamin Rutt
Subject When was ANALYZE run in the past?
Date
Msg-id CAMWA1_pYy6sAQg3xwQe66ma1wRgvin2YTDqQb2ZTKhBq+u5k6Q@mail.gmail.com
Whole thread Raw
Responses Re: When was ANALYZE run in the past?
Re: When was ANALYZE run in the past?
List pgsql-general
 
    SELECT reltuples FROM pg_class WHERE relname = 'tbl';
 
may be a good way to get an estimate of the # of rows in the table, but depends on how frequently ANALYZE has been running.  I run autovacuum under a default configuration, but I suspect ANALYZE is not running frequently enough for my purposes (when I ran the above command on my table, it consistently returned 1.4 million for ~20 minutes straight; when I explicitly ran an ANALYZE command at that point (when I realized the estimate was not updating even every few minutes), the ANALYZE command took a few seconds, then the above command returned .7 million which matches what ‘select count(*)’ was returning).  So I suspect ANALYZE is not running frequently enough or is stepping over my table for some reason.
 
So, given the above context, my question is, is there any way to tell at what times ANALYZE has been run in the past on the db or on a particular table?  I am running a fairly vanilla postgres 8.4 db on linux, with a few minor tweaks to postgresql.conf:
 
synchronous_commit = off
log_line_prefix = '%t '
log_min_messages = info
 
I don’t see anything in the stderr of the db other than the following:
 
2014-11-26 20:01:55 GMT LOG:  database system was shut down at 2014-11-26 18:39:41 GMT
2014-11-26 20:01:55 GMT LOG:  database system is ready to accept connections
2014-11-26 20:01:55 GMT LOG:  autovacuum launcher started
 
Thanks!
 



--
Benjamin Rutt

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Problem with pg_dump and decimal mark
Next
From: Bill Moran
Date:
Subject: Re: When was ANALYZE run in the past?