| От | Greg Stark |
|---|---|
| Тема | More Hashing questions |
| Дата | |
| Msg-id | 87fzafyfou.fsf@stark.xeocode.com обсуждение исходный текст |
| Ответы |
Re: More Hashing questions
|
| Список | pgsql-hackers |
Regarding inter-data-type hash joins, would it make sense to make float
datatypes to hash to the same value as integral data types for integral
values?
Conveniently this would cover the existing special case of -0 and +0 hashing
to the same value. Something like this?
Datum
hashfloat4(PG_FUNCTION_ARGS)
{float4 key = PG_GETARG_FLOAT4(0);
if (key == (int32)key) PG_RETURN_UINT32(~(int32)key);
return hash_any((unsigned char *) &key, sizeof(key));
}
Incidentally, why do all the floatfoo functions invert the value? It doesn't
seem like that affects the quality of the hash at all.
--
greg
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера