Re: Why hash indexes suck

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why hash indexes suck
Дата
Msg-id 12412.1086480954@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why hash indexes suck  (Jeff Davis <jdavis-pgsql@empires.org>)
Список pgsql-hackers
Jeff Davis <jdavis-pgsql@empires.org> writes:
> On Sat, 2004-06-05 at 13:31, Tom Lane wrote:
>> Only if you want to require a hash opclass to supply ordering operators,
>> which sort of defeats the purpose I think.  Hash is only supposed to
>> need equality not ordering.

> Is it possible to assume some kind of ordering (i.e. strcmp() the binary
> data of the type) as long as it's consistent?

Not really; that would assume that equality of the datatype is the same
as bitwise equality, which is not the case in general (consider -0
versus +0 in IEEE floats, or any datatype with pad bits in the struct).
Some time ago we got rid of the assumption that hash should hash on all
the bits without any type-specific intervention, and I don't want to
reintroduce those bugs.

We could safely sort on the hash value, but I'm not sure how effective
that would be, considering that we're talking about values that already
hashed into the same bucket --- there's likely not to be very many
distinct hash values there.
        regards, tom lane


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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Why hash indexes suck
Следующее
От: "Thomas Hallgren"
Дата:
Сообщение: Re: Advice regarding configuration parameters