Re: Index trouble with 8.3b4 - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Index trouble with 8.3b4
Date
Msg-id 873at0hc5p.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Index trouble with 8.3b4  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Oooh ... I can't be sure that this is what's biting you, but I
> definitely see a bug that seems to match the symptoms.  As the comments
> in index.c point out, CREATE INDEX CONCURRENTLY works like this:
>
>  * validate_index() works by first gathering all the TIDs currently in the
>  * index, using a bulkdelete callback that just stores the TIDs and doesn't
>  * ever say "delete it".  (This should be faster than a plain indexscan;
>  * also, not all index AMs support full-index indexscan.)  Then we sort the
>  * TIDs, and finally scan the table doing a "merge join" against the TID list
>  * to see which tuples are missing from the index.
>
> The scan is done using the regular heapscan code, which in 8.3 has been
> modified to enable "synchronized scanning", which means it might start
> from the middle of the table and wrap around.  

Wow, I'm glad we caught this in beta. Thanks a lot to Hannes Dorbath for
testing and reporting it.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


pgsql-hackers by date:

Previous
From: Hannes Dorbath
Date:
Subject: Re: Index trouble with 8.3b4
Next
From: Mark Mielke
Date:
Subject: Re: Postgresql Materialized views