Planning to force reindex of hash indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Planning to force reindex of hash indexes
Date
Msg-id 9263.1062515004@sss.pgh.pa.us
Whole thread Raw
Responses Re: Planning to force reindex of hash indexes  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
I've found a number of infelicities in the hash index code that can't be
fixed without an on-disk format change.  The biggest one is that the 
hashm_ntuples field in hash meta pages is only uint32, meaning that
hash index space management will become confused if the number of
entries exceeds 4G.  I'd like to change it to a "double", and clean up
a couple other uglinesses at the same time.

Ordinarily I'd just force an initdb for such a change, but at this late
stage of the 7.4 cycle it seems better to avoid requiring initdb,
especially since many beta testers wouldn't be using hash indexes anyway
and shouldn't need to reload.  What I intend to do instead is increment
the version number that already exists in the hash metapage, and add
code to spit out a "please reindex this index" error if the version
number isn't right.  A REINDEX command would be sufficient to
reconstruct the index in the new format.

Any objections?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jenny -"
Date:
Subject: granularity of locking
Next
From: "Alexander Schulz"
Date:
Subject: Re: Win32 native port