Re: VACUUM ANALYZE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Anthony <DavidA(at)tradeworld(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: VACUUM ANALYZE
Date: 2002-01-14 22:11:10
Message-ID: 19596.1011046270@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

David Anthony <DavidA(at)tradeworld(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-01-15 01:22:59 Re: Error compiling on SCO
Previous Message Jan Wieck 2002-01-14 20:30:54 Re: Commercial: New Book!! PostgreSQL book is released into