diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-11-19 09:24:37 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-11-19 09:32:47 +0100 |
commit | 01e658fa74cb7e3292448f6663b549135958003b (patch) | |
tree | d87a206912e085d7bcdadc424b571055055e58e2 /src/backend/utils/cache/lsyscache.c | |
parent | 7888b0999488511e4266f2134053fa3a6505a155 (diff) | |
download | postgresql-01e658fa74cb7e3292448f6663b549135958003b.tar.gz postgresql-01e658fa74cb7e3292448f6663b549135958003b.zip |
Hash support for row types
Add hash functions for the record type as well as a hash operator
family and operator class for the record type. This enables all the
hash functionality for the record type such as hash-based plans for
UNION/INTERSECT/EXCEPT DISTINCT, recursive queries using UNION
DISTINCT, hash joins, and hash partitioning.
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/38eccd35-4e2d-6767-1b3c-dada1eac3124%402ndquadrant.com
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 140339073b6..ae232991623 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -1358,13 +1358,18 @@ op_hashjoinable(Oid opno, Oid inputtype) TypeCacheEntry *typentry; /* As in op_mergejoinable, let the typcache handle the hard cases */ - /* Eventually we'll need a similar case for record_eq ... */ if (opno == ARRAY_EQ_OP) { typentry = lookup_type_cache(inputtype, TYPECACHE_HASH_PROC); if (typentry->hash_proc == F_HASH_ARRAY) result = true; } + else if (opno == RECORD_EQ_OP) + { + typentry = lookup_type_cache(inputtype, TYPECACHE_HASH_PROC); + if (typentry->hash_proc == F_HASH_RECORD) + result = true; + } else { /* For all other operators, rely on pg_operator.oprcanhash */ |