| From: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> | 
|---|---|
| To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Hash support for row types | 
| Date: | 2020-10-19 08:01:14 | 
| Message-ID: | 38eccd35-4e2d-6767-1b3c-dada1eac3124@2ndquadrant.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
In [0] it was discussed that hash support for row types/record would be 
handy.  So I implemented that.
The implementation hashes each field and combines the hash values.  Most 
of the code structure can be borrowed from the record comparison 
functions/btree support.  To combine the hash values, I adapted the code 
from the array hashing functions.  (The hash_combine()/hash_combine64() 
functions also looked sensible, but they don't appear to work in a way 
that satisfies the hash_func regression test.  Could be documented better.)
The main motivation is to support UNION [DISTINCT] as discussed in [0], 
but this also enables other hash-related functionality such as hash 
joins (as one regression test accidentally revealed) and hash partitioning.
-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
| Attachment | Content-Type | Size | 
|---|---|---|
| v1-0001-Hash-support-for-row-types.patch | text/plain | 19.2 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ajin Cherian | 2020-10-19 08:20:46 | Re: Track statistics for streaming of in-progress transactions | 
| Previous Message | Dmitry Shulga | 2020-10-19 07:58:15 | Re: Reduce the time required for a database recovery from archive. |