Re: Question on Postgres Index internals

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: A J <s5aly(at)yahoo(dot)com>
Cc: PG Admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Question on Postgres Index internals
Date: 2011-08-19 06:40:51
Message-ID: 4E4E0573.2010508@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 19/08/2011 5:46 AM, A J wrote:
> How does Postgres detect corruption of index data files ?
If their structure doesn't make sense, they're corrupt. It doesn't
actively seek or detect corruption, because it shouldn't happen, and
cannot be reliably discovered if it has.
> What is the exact mechanism by which it knows that the index is corrupt ?
Numerous different ways, depending on the nature of the damage and the
type of index. Often it won't know the index is damaged at all.
> Can it happen that part of the index is corrupt but Postgres does not
> realize because those specific rows are not accessed (but other rows
> from that table are accessed)
>
Yes, that is possible. It is also possible that a damaged index could
cause issues like multiple instances of a value that's supposed to be
unique, or a foreign key reference to a non-existent tuple.

Index corruption should not happen. If you are facing index corruption,
either you have a hardware problem or you've hit a bug. The vast
majority of cases are hardware faults.

Perhaps it'd help if you'd supply a little more detail about the
background. Why you're asking this, and why you (presumably) suspect you
have index corruption.

--
Craig Ringer

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Venkat Balaji 2011-08-19 06:46:19 Re: PostgreSQL-9.0.1
Previous Message Craig James 2011-08-18 23:44:13 Londiste won't start with dual IP addresses