Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id B49BC2E0038 for ; Sun, 6 Apr 2008 13:02:59 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 26755-04 for ; Sun, 6 Apr 2008 13:02:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 48E662E002E for ; Sun, 6 Apr 2008 13:02:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m36G2Prf000712; Sun, 6 Apr 2008 12:02:25 -0400 (EDT) To: Kenneth Marshall cc: Simon Riggs , pgsql-patches@postgresql.org, twraney@comcast.net, neilc@samurai.com Subject: Re: updated hash functions for postgresql v1 In-reply-to: <20080405214050.GA4802@it.is.rice.edu> References: <20071027201557.GW27320@it.is.rice.edu> <1193592458.4242.713.camel@ebony.site> <20071028180558.GY27320@it.is.rice.edu> <1193602018.4242.737.camel@ebony.site> <23832.1207424435@sss.pgh.pa.us> <20080405214050.GA4802@it.is.rice.edu> Comments: In-reply-to Kenneth Marshall message dated "Sat, 05 Apr 2008 16:40:50 -0500" Date: Sun, 06 Apr 2008 12:02:25 -0400 Message-ID: <711.1207497745@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/164 X-Sequence-Number: 5665 Kenneth Marshall writes: > Okay, I will strip the VALGRIND paths. I did not see a real need for them > either. I have a patch ready to commit (as soon as I fix the regression test issues) that incorporates all the word-wide-ness stuff. All you really need to look at is the question of hash quality. I did confirm that the mixing changes account for a noticeable chunk of the runtime improvement. For instance on a Xeon hash_any_old(32K): 4.386922 s (CVS HEAD) hash_any(32K): 3.853754 s (CVS + word-wide calcs) hashword(32K): 3.041500 s (from patch) hashlittle(32K): 3.092297 s (from patch) hash_any_old(32K unaligned): 4.390311 s hash_any(32K unaligned): 4.380700 s hashlittle(32K unaligned): 3.464802 s hash_any_old(8 bytes): 1.580008 s hash_any(8 bytes): 1.293331 s hashword(8 bytes): 1.137054 s hashlittle(8 bytes): 1.112997 s So adopting the mixing changes would make it faster yet. What we need to be certain of is that this doesn't expose us to poorer hashing. We know that it is critical that all bits of the input affect all bits of the hash fairly uniformly --- otherwise we are subject to very serious performance hits at higher levels in hash join, for instance. The comments in the new code led me to worry that Jenkins had compromised on that property in search of speed. I looked at his website but couldn't find any real discussion of the design principles for the new mixing code ... regards, tom lane