Re: Problem with corrupt index - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with corrupt index
Date
Msg-id 23634.1033411249@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem with corrupt index  (Alvaro Herrera <alvherre@atentus.com>)
List 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

pgsql-general by date:

Previous
From: "Oleg Lebedev"
Date:
Subject: 7.2.1 to 7.3b1
Next
From: Tom Lane
Date:
Subject: Re: Major Problem with locale