On Mon, Aug 1, 2016 at 7:24 AM, Dean Rasheed <dean.a.rash...@gmail.com> wrote: > On 1 August 2016 at 08:19, Greg Stark <st...@mit.edu> wrote: >> Surely combining multiple hashes is the same problem as hashing a block of >> memory? Shouldn't we just use the same algorithm as hash_any()? > > Yes, I imagine that should work well. I suspect that Thomas's proposal > would also probably work well, as would a number of other hashing > algorithms with reasonable pedigree, such as the one used for array > hashing. I don't have any particular preference, but I do know that > what usually turns out to be disastrous is an arbitrary made-up > formula like rotating and xor'ing. The last thing we should attempt to > do is invent our own hashing algorithms.
+1. (x << 1) | y isn't the stupidest way of combining hash values anybody's ever invented, but there are surely others that are better. I don't much care whether we adopt Thomas's proposal or Greg's or something else, but I can't see why we'd stick with (x << 1) | y when better approaches are known. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers