Re: Addled index

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Oleg Alexeev <oalexeev(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Addled index
Date: 2013-03-15 21:21:17
Message-ID: 514390CD.3080203@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/15/2013 11:29 AM, Oleg Alexeev wrote:
> 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?
>
What version??

Cheers,
Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2013-03-16 06:16:33 Re: C++Builder table exist
Previous Message Kevin Grittner 2013-03-15 20:09:31 Re: big un stacking query - help save me from myself