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