Matthew <matt(at)ctlno(dot)com> writes:
> [ a tale of woe ]
It looks like dropping and rebuilding *all* the indexes on your history
table would be a good move (possibly with a vacuum of the table while
the indexes are removed). You might want to do a COPY out to try to
save the table data before the vacuum, in case there is corruption in
the table as well as the indexes.
Before you do all that, though, how big is the database? Would you be
able/willing to tar up the whole $PGDATA tree and let some of us analyze
it?
regards, tom lane