Re: Hash Functions

From: Andres Freund <andres(at)anarazel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>,Jeff Davis <pgsql(at)j-davis(dot)com>,Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>,amul sul <sulamul(at)gmail(dot)com>
Subject: Re: Hash Functions
Date: 2017-05-14 03:47:39
Message-ID: 52778957-B778-415F-AEC1-CFD9F4842BCB@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May 13, 2017 8:44:22 PM PDT, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>On Sat, May 13, 2017 at 7:08 PM, Andres Freund <andres(at)anarazel(dot)de>
>wrote:
>> I seriously doubt that's true. A lot of more complex types have
>> internal alignment padding and such.
>
>True, but I believe we require those padding bytes to be zero. If we
>didn't, then hstore_hash would be broken already.

It'll be differently sized on different platforms. So everyone will have to write hash functions that look at each member individually, rather than hashing the entire struct at once. And for each member you'll have to use a type specific hash function...

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2017-05-14 03:54:09 Re: Latest Data::Dumper breaks hstore_plperl regression test
Previous Message Robert Haas 2017-05-14 03:44:22 Re: Hash Functions