pgsql: Add a hash function for "numeric". - Mailing list pgsql-committers

From [email protected] (Neil Conway)
Subject pgsql: Add a hash function for "numeric".
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        numeric.c (r1.101 -> r1.102)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/numeric.c.diff?r1=1.101&r2=1.102)
    pgsql/src/include/catalog:
        catversion.h (r1.404 -> r1.405)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h.diff?r1=1.404&r2=1.405)
        pg_amop.h (r1.80 -> r1.81)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_amop.h.diff?r1=1.80&r2=1.81)
        pg_amproc.h (r1.64 -> r1.65)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_amproc.h.diff?r1=1.64&r2=1.65)
        pg_opclass.h (r1.75 -> r1.76)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_opclass.h.diff?r1=1.75&r2=1.76)
        pg_operator.h (r1.151 -> r1.152)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_operator.h.diff?r1=1.151&r2=1.152)
        pg_opfamily.h (r1.4 -> r1.5)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_opfamily.h.diff?r1=1.4&r2=1.5)
        pg_proc.h (r1.454 -> r1.455)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h.diff?r1=1.454&r2=1.455)
    pgsql/src/include/utils:
        builtins.h (r1.291 -> r1.292)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/builtins.h.diff?r1=1.291&r2=1.292)

pgsql-committers by date:

Previous
From: [email protected] (User Cunha17)
Date:
Subject: snapshot - drivers: Missing BASE_SCHEMA placeholder
Next
From: [email protected] (Tom Lane)
Date:
Subject: pgsql: Reserve some pg_statistic "kind" codes for use by the ESRI