Gavin Sherry <swm@alcove.com.au> writes:
> On Mon, 9 Apr 2007, Tom Lane wrote:
>> ... I don't see any way to make it completely bulletproof
>> without enlarging the special space, which seems an unreasonable price
>> to pay. But even one chance in 16K is way better than the current
>> situation.
> Sounds like the only workable approach.
Actually, I realized after writing that that it *is* possible to make it
bulletproof: all we have to do is make the BTCycleId wrap around at a
little less than 64K, which adds about one line of code and doesn't
materially change its reliability. That leaves a few bitpatterns free
for IDs of other index types with no chance of collision. I made hash
use 0xFF80 and gist 0xFF81; please use 0xFF82 for bitmaps. (GIN turns
out not to need a code because its special space is a different size,
so we can tell it apart anyway.)
See patch already committed here:
http://archives.postgresql.org/pgsql-committers/2007-04/msg00125.php
regards, tom lane