I have a database that was populated about two months ago, and one
particular table has begun causing problems. It's got about 20,000
records, all fixed length of about 1 kbytes. If we do any operation
that involves a sequential scan of that table (e.g., select count(*)),
it now takes about 20 seconds, and according to linux vmstat, reads
275000 disk blocks (275 mbytes). The database is vacuumed each night.
I made a copy of the table (create table c2 select * from c), and a
count on that table takes much less than a second.
Any ideas on what the difference in these tables could be, and how
I can avoid this problem?
Thanks.