PostgreSQL's hash functions (src/common/hashfn.c, Bob Jenkins' lookup3, little-endian) as the extended, seeded, 64-bit variants hash partitioning uses, and the routing of a row to a hash partition (satisfies_hash_partition). Values hash as the database hashes them: integers through hashint8extended (which agrees with hashint4 and hashint2 for the values they share), text through its bytes (a deterministic collation), booleans and dates as 32-bit integers, timestamps as microseconds since 2000, uuids as their 16 bytes.
PostgreSQL's hash functions (src/common/hashfn.c, Bob Jenkins' lookup3, little-endian) as the extended, seeded, 64-bit variants hash partitioning uses, and the routing of a row to a hash partition (satisfies_hash_partition). Values hash as the database hashes them: integers through hashint8extended (which agrees with hashint4 and hashint2 for the values they share), text through its bytes (a deterministic collation), booleans and dates as 32-bit integers, timestamps as microseconds since 2000, uuids as their 16 bytes.
(hash-bytes-extended k seed)hash_bytes_extended: a 64-bit hash of bytes with a seed.
hash_bytes_extended: a 64-bit hash of bytes with a seed.
(hash-int8-extended v seed)hashint8extended: the high half folded into the low, so an int4 and an int8 of the same value hash alike.
hashint8extended: the high half folded into the low, so an int4 and an int8 of the same value hash alike.
(hash-uint32-extended k seed)hash_bytes_uint32_extended: a 64-bit hash of one 32-bit value with a seed.
hash_bytes_uint32_extended: a 64-bit hash of one 32-bit value with a seed.
(hash-value v)The database's hash of a partition key value with the partition seed, or nil for a value pgmalli cannot hash like the database (a numeric, an enum, an interval).
The database's hash of a partition key value with the partition seed, or nil for a value pgmalli cannot hash like the database (a numeric, an enum, an interval).
(satisfies-hash-partition? modulus remainder vs)Whether a row whose partition key values are vs lands in the partition of the given modulus and remainder: the database's satisfies_hash_partition. nil when a value cannot be hashed like the database.
Whether a row whose partition key values are vs lands in the partition of the given modulus and remainder: the database's satisfies_hash_partition. nil when a value cannot be hashed like the database.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |