X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CA09647592C for ; Thu, 10 Apr 2003 13:51:24 -0400 (EDT) Received: from snoopy.oit.edu (snoopy.OIT.EDU [140.211.135.12]) by postgresql.org (Postfix) with ESMTP id 8772E474E42 for ; Thu, 10 Apr 2003 13:51:22 -0400 (EDT) Received: from cvc.net (purvine-141-62.oit.edu [140.211.141.62]) by snoopy.oit.edu (8.12.9/8.12.9/OIT-4.0) with ESMTP id h3AHpIGM029932; Thu, 10 Apr 2003 10:51:19 -0700 Message-ID: <3E95AF8F.7010707@cvc.net> Date: Thu, 10 Apr 2003 10:53:19 -0700 From: Dennis Gearon Reply-To: gearond@cvc.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030210 X-Accept-Language: en-us, ru MIME-Version: 1.0 To: Amir Becher Cc: Tom Lane , pgsql-general@postgresql.org Subject: Re: Corrupt index References: <20030410172120.98514.qmail@web13904.mail.yahoo.com> In-Reply-To: <20030410172120.98514.qmail@web13904.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-38.8 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/644 X-Sequence-Number: 40709 exactly what are your indexes on this, as well as any triggers? Amir Becher wrote: > 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 wrote: > >>Amir Becher 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >