Addled index - Mailing list pgsql-general

From Oleg Alexeev
Subject Addled index
Date
Msg-id CAHgtPcVuF977UO2uyBLoy4u+y2V9Crznk5+x42tki6bB5LkcOA@mail.gmail.com
Whole thread Raw
Responses Re: Addled index
List pgsql-general
We've faced with strange index problem.

At some moment index became bad and queries does not return any data.

For example, there are two tables - A (id, name) and B (id, name, a_id). B.a_id is foreign key to A. Both name columns in tables contains identical values for A.id = B.a_id. A.name column has unique constraint and additional index by it.

So, in some moment results for queries like [select id from A where name = 'petya'] became empty (row with 'petya' name exist in  A).

But query [select a_id from B where name = 'petya'] returns A.id and [select * from A where id = <found id>] returns row.

This problem can be solved by index recreation only.

How can we avoid such situation?

--
Oleg V Alexeev
E:oalexeev@gmail.com

pgsql-general by date:

Previous
From: Bob Brown
Date:
Subject: link
Next
From: Kevin Grittner
Date:
Subject: Re: big un stacking query - help save me from myself