Skip site navigation (1) Skip section navigation (2)

pgsql: Add a hash function for "numeric".

From: neilc(at)postgresql(dot)org (Neil Conway)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a hash function for "numeric".
Date: 2007-05-08 18:56:48
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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:
        numeric.c (r1.101 -> r1.102)
        catversion.h (r1.404 -> r1.405)
        pg_amop.h (r1.80 -> r1.81)
        pg_amproc.h (r1.64 -> r1.65)
        pg_opclass.h (r1.75 -> r1.76)
        pg_operator.h (r1.151 -> r1.152)
        pg_opfamily.h (r1.4 -> r1.5)
        pg_proc.h (r1.454 -> r1.455)
        builtins.h (r1.291 -> r1.292)

pgsql-committers by date

Next:From: Tom LaneDate: 2007-05-08 19:13:52
Subject: pgsql: Reserve some pg_statistic "kind" codes for use by the ESRI
Previous:From: User Cunha17Date: 2007-05-08 17:10:18
Subject: snapshot - drivers: Missing BASE_SCHEMA placeholder

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group