More Hashing questions

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: PITR logging control program
Следующее
От: "Carl E. McMillin"
Дата:
Сообщение: Re: Hacking postgres backend process