Tim Perdue <tim@perdue.net> writes:
> I thought the hackers team would be interested in knowing that SourceForge,
> as of Friday evening, is running on Postgres.
Cool!
> I'm running into some places where the query optimizer is not using the right
> indexes, and sometimes does sequential scans on tables.
I assume you've done a VACUUM ANALYZE at least once since loading up
your data?
It'd be useful to see the results of an EXPLAIN for the problem query,
both with and without SET ENABLE_SEQSCAN TO OFF. Also, it'd be helpful
to see VACUUM's stats for the relevant tables. You can get those for
a table named 'FOO' with
select attname,attdisbursion,s.*
from pg_statistic s, pg_attribute a, pg_class c
where starelid = c.oid and attrelid = c.oid and staattnum = attnum
and relname = 'FOO';
regards, tom lane