pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amir Becher <abecher@yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org
Subject: Re: Corrupt index
Date: Thu, 10 Apr 2003 10:21:20 -0700 (PDT)
Message-ID: <20030410172120.98514.qmail@web13904.mail.yahoo.com> (raw)
In-Reply-To: <4833.1049992793@sss.pgh.pa.us>

Here is an example of the misbehavior that I am
seeing:

A simple table with 3 colums (and approximately a
million records):
column_a INTEGER PRIMARY KEY
column_b DATE NOT NULL
column_c DOUBLE NOT NULL

When the index (primary key) gets corrupted, I get the
following behavior when I do a simple SELECT (using
the psql program):

SELECT * FROM example_table WHERE (column_a = 12345);

The result looks like:

column_a | column_b   | column_c
--------------------------------
67890    | 2001-01-01 | 100

The main point is that "column_a" is the wrong number.

When I use the EXPLAIN command, it tells me that it's
doing an index scan using the primary key index.
Issuing a "REINDEX TABLE example_table" command fixes
the problem.

I usually detect the problem when an INSERT fails
(batch insert fails due to duplicate key). I also
delete a few thousand records before the inserts. All
of the inserts and deletes are done throught the JDBC3
driver.

Please let me know what additional information you
would like me to provide.

--- Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amir Becher <abecher@yahoo.com> writes:
> > I am experiencing frequent index corruptions
> (almost
> > daily).
> 
> Please define your problem: what misbehavior are you
> actually seeing?
> Give us facts, not interpretations.
> 
> 			regards, tom lane


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com




view thread (25+ messages)  latest in thread

Message-ID: <20030410172120.98514.qmail@web13904.mail.yahoo.com>
Permalink:  ../20030410172120.98514.qmail@web13904.mail.yahoo.com/
Also on:    postgresql.org/message-id/20030410172120.98514.qmail@web13904.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: abecher@yahoo.com, tgl@sss.pgh.pa.us
  Subject: Re: Corrupt index
  In-Reply-To: <20030410172120.98514.qmail@web13904.mail.yahoo.com>
  References: <4833.1049992793@sss.pgh.pa.us> <20030410172120.98514.qmail@web13904.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox