Re: Hash function for numeric (WIP)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Hash function for numeric (WIP)
Дата
Msg-id 10004.1178251044@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Hash function for numeric (WIP)  (Neil Conway <neilc@samurai.com>)
Ответы Re: Hash function for numeric (WIP)  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> On Mon, 2007-30-04 at 00:04 -0400, Tom Lane wrote:
>> I'm still not very comfortable with that.  You're proposing to add a
>> pretty obvious failure mechanism --- any numeric-returning function
>> that failed to "normalize" its output would now create a subtle,
>> hard-to-find bug.

> What about teaching hash_numeric() to explicitly ignore leading and
> trailing zero digits?

Hm, but apply hash_any() to the remaining digits?  That might work, if
you are careful about how you factor the weight into it (or just not try
to use the weight in the hash).

>> Perhaps a suitable test would be to compare the number of
>> hash collisions in a large set of randomly-chosen-but-distinct
>> numeric values.

> Okay, I did a little testing.
> [ test that totally destroys my proposed hash function ]

OK, so *that* idea doesn't work.  How about yours above?

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: Hash function for numeric (WIP)
Следующее
От: Mark Kirkwood
Дата:
Сообщение: Re: Updated bitmap index patch