git.postgresql.org Git - postgresql.git/commit
Tue, 8 May 2007 18:56:48 +0000 (18:56 +0000)
Tue, 8 May 2007 18:56:48 +0000 (18:56 +0000)
commit ade493e02d25f4807c02dcd763a25d4232b3b68d
Add a hash function for "numeric". Mark the equality operator for
numerics as "oprcanhash", and make the corresponding system catalog
updates. As a result, hash indexes, hashed aggregation, and hash
joins can now be used with the numeric type. Bump the catversion.
The only tricky aspect to doing this is writing a correct hash
function: it's possible for two Numerics to be equal according to
their equality operator, but have different in-memory bit patterns.
To cope with this, the hash function doesn't consider the Numeric's
"scale" or "sign", and explictly skips any leading or trailing
zeros in the Numeric's digit buffer (the current implementation
should suppress any such zeros, but it seems unwise to rely upon
this). See discussion on pgsql-patches for more details.
This is the main PostgreSQL git repository.
RSS
Atom