Re: VACUUM ANALYZE - Mailing list pgsql-novice

From Tom Lane
Subject Re: VACUUM ANALYZE
Date
Msg-id 19596.1011046270@sss.pgh.pa.us
Whole thread Raw
In response to VACUUM ANALYZE  (David Anthony <DavidA@tradeworld.net>)
List pgsql-novice
David Anthony <DavidA@tradeworld.net> writes:
> Any other things I should look at?

Are your queries actually using the indexes?  See EXPLAIN.

> Also, is there a way to check when the
> last time VACUUM ANALYZE was run on the db. I am unsure whether the perl
> script is running the command successfully.

Look to see if there's up-to-date info in pg_statistic for the table,
eg with

select attname,attdispersion,s.*
from pg_statistic s, pg_attribute a, pg_class c
where starelid = c.oid and attrelid = c.oid and staattnum = attnum
and relname = 'WHATEVER';

This isn't timestamped in any way, but you could try doing a manual
"delete from pg_statistic" and then see if your script repopulates it.

            regards, tom lane

pgsql-novice by date:

Previous
From: "Travis Hoyt"
Date:
Subject: Re: VACUUM ANALYZE
Next
From: Tom Lane
Date:
Subject: Re: Error compiling on SCO