Re: Hash function for numeric (WIP) - Mailing list pgsql-patches

From Neil Conway
Subject Re: Hash function for numeric (WIP)
Date
Msg-id 1178502719.18303.176.camel@goldbach
Whole thread Raw
In response to Re: Hash function for numeric (WIP)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Sun, 2007-06-05 at 21:30 -0400, Tom Lane wrote:
> You can do it always if you simply decrement the weight for each leading
> zero removed.

On reflection, the patch as given was wrong anyway: if two Numerics are
identical except for the presence of leading zeroes, we can't consider
the weight when hashing one of them but not the other.

> The patch as given is wrong since it makes the test for no-digits
> before instead of after removing zeroes.)

Okay, how about the attached revision?

> It'd be a good idea if you repeat the previous number-of-collisions
> experiment on this code.

I'll do this shortly.

-Neil


Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hash function for numeric (WIP)
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: Clear up strxfrm() in UTF-8 with locale on Windows