Re: Problem with corrupt index
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@atentus.com>
Cc: Diogo Biazus <diogo@ikono.com.br>, pgsql-general@postgresql.org
Date: 2002-09-30T18:40:49Z
Lists: pgsql-general
Alvaro Herrera <alvherre@atentus.com> writes: > If you only have 7 registers in the table, you don't need the index > anyway: a sequential scan is much faster. My advice would be to drop > the index. Mine too. > If you have a primary key you can't do that, and you'll have > to continue doing REINDEX and VACUUM periodically. In any case, the fact you are having this problem suggests that you aren't doing VACUUMs often enough on this table. If you've got seven live rows and you update one of them every 5 seconds, then after an hour you have seven live rows and 720 dead ones. Things are going to be a good bit slower than before. If you wait days between vacuums then it gets worse. I'd recommend putting in a cron task to vacuum this particular table hourly, or maybe even oftener. regards, tom lane