Hash function for numeric (WIP)

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Hash function for numeric (WIP)
Дата
Msg-id 1177660069.6440.114.camel@localhost.localdomain
обсуждение исходный текст
Ответы Re: Hash function for numeric (WIP)
Список pgsql-patches
There is currently no support for hashing numerics. This prevents
numerics from being hash indexed or used in a hashed aggregation. This
patch makes the necessary changes to the catalogs to enable hashing for
numerics, and implements a first sketch at a hash function for numerics.

For any two numerics that compare equal, we need to compute the same
hash value for both datums, even if their bit patterns differ. This
patch computes the hash from the "n_weight" and "n_data" fields of the
numeric -- notably, it doesn't use the numeric's "scale" field, since
two equal numerics may have different scales. The hash seems to return
the correct results for the simple test cases that I've tried, but I'm
not very familiar with the details of the numeric implementation -- can
anyone comment on whether this hash function is correct?

Thanks to Sailesh Krishnamurthy for reporting this problem.

-Neil


Вложения

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

Предыдущее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: New version of GENERATED/IDENTITY, was Re: parser dilemma
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Hash function for numeric (WIP)