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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to