Saner interval hash function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Saner interval hash function
Date: 2009-04-03 21:46:05
Message-ID: 23798.1238795165@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The present implementation of interval_hash() is very carefully designed
and coded ... to meet the wrong specification :-(. What it should
be doing is producing equal hashcodes for values that interval_eq()
considers equal. The error is exhibited in the recent bug report #4748.

Attached is a prototype fix for this, which I have verified fixes #4748.
The only problem with applying it is that it changes the contents of
hash indexes on interval columns. This is no problem for HEAD, seeing
that we've already whacked around hash indexes in far more fundamental
ways than that since 8.3. However, since interval hashing is broken
in this way in every active branch, we really ought to back-patch.

I don't think there's a whole lot of choice in the matter. We have to
patch this, and put in the next release notes "if you have any hash
indexes on interval columns, REINDEX them after updating". Does anyone
see it differently, or have some brilliant idea for another solution?

regards, tom lane

Attachment Content-Type Size
unknown_filename text/plain 2.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-03 22:28:19 Re: GetCurrentVirtualXIDs()
Previous Message Grzegorz Jaskiewicz 2009-04-03 21:18:40 Re: a few crazy ideas about hash joins