unique index corruption

From: pg noob <pgnube(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: unique index corruption
Date: 2013-07-24 18:50:15
Message-ID: CAPNY-2WHrZzL6Y+a+Y3whA+4qZCObPOxiLN5KoQRiHT1-i9oxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

In PostgreSQL 8.4...

I am wondering if autovacuum will periodically rebuild indexes?

If not, how advisable is it to reindex periodically?

We recently had a case of unique index corruption which ended up allowing
duplicate
primary key IDs to get inserted and caused widespread data model integrity
havoc.

The system ran for several days before it was noticed.

After the problem was discovered we found that a reindex would fail because
there were
duplicate ID values.

Our thought is that if we had a scheduled cron job that would periodically
do a reindex this
corruption might have been caught sooner by detecting the reindex failure.

If a reindex is something that should be done frequently as part of regular
maintenance
why isn't there a mode of autovacuum that does this automatically? Or
maybe there is and
I just don't know about it..?

Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message devonline 2013-07-24 19:31:48 Tablespace on Postgrsql
Previous Message Tom Lane 2013-07-24 18:41:50 Re: [GENERAL] Insert result does not match record count