Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 122769F9F26 for ; Sun, 28 Oct 2007 17:08:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 94219-09 for ; Sun, 28 Oct 2007 17:08:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from outmail129181.authsmtp.co.uk (outmail129181.authsmtp.co.uk [62.13.129.181]) by postgresql.org (Postfix) with ESMTP id ADC319F9F1F for ; Sun, 28 Oct 2007 17:08:33 -0300 (ADT) Received: from outmail128180.authsmtp.com (outmail128180.authsmtp.com [62.13.128.180]) by punt3.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id l9SK8Px4001345; Sun, 28 Oct 2007 20:08:31 GMT Received: from [192.168.0.3] (62-3-250-177.dyn.gotadsl.co.uk [62.3.250.177]) (authenticated bits=0) by mail.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id l9SK8RLY096855; Sun, 28 Oct 2007 20:08:27 GMT Subject: Re: updated hash functions for postgresql v1 From: Simon Riggs To: Kenneth Marshall Cc: pgsql-patches@postgresql.org, twraney@comcast.net, neilc@samurai.com In-Reply-To: <20071028180558.GY27320@it.is.rice.edu> References: <20071027201557.GW27320@it.is.rice.edu> <1193592458.4242.713.camel@ebony.site> <20071028180558.GY27320@it.is.rice.edu> Content-Type: text/plain Date: Sun, 28 Oct 2007 20:06:58 +0000 Message-Id: <1193602018.4242.737.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Server-Quench: 8bd3d609-8591-11dc-b86a-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksachtFag1bYlpF HGQLW1NEUl17WWt/ aQ0fawdDYVRMWgV0 UU9OXVBXCwUmXRVi fRZ8LnByfgNOfXs+ Z0RkXj5TDhB5IUB9 S1NcEGQHeGZhPDMC AkheJh5UcAJLdhoR aVd4ByJDAzANdhEA NjMYHx0KCH1CMChc XgwBZVIbWkZDECM6 TAwDGjM0VUMCXW0r KAc6JUQRB18Veltr WXNh X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:752/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL=0.007, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200710/230 X-Sequence-Number: 4229 On Sun, 2007-10-28 at 13:05 -0500, Kenneth Marshall wrote: > On Sun, Oct 28, 2007 at 05:27:38PM +0000, Simon Riggs wrote: > > On Sat, 2007-10-27 at 15:15 -0500, Kenneth Marshall wrote: > > > Its features include a better and faster hash function. > > > > Looks very promising. Do you have any performance test results to show > > it really is faster, when compiled into Postgres? Better probably needs > > some definition also; in what way are the hash functions better? > > > > -- > > Simon Riggs > > 2ndQuadrant http://www.2ndQuadrant.com > > > The new hash function is roughly twice as fast as the old function in > terms of straight CPU time. It uses the same design as the current > hash but provides code paths for aligned and unaligned access as well > as separate mixing functions for different blocks in the hash run > instead of having one general purpose block. I think the speed will > not be an obvious win with smaller items, but will be very important > when hashing larger items (up to 32kb). > > Better in this case means that the new hash mixes more thoroughly > which results in less collisions and more even bucket distribution. > There is also a 64-bit varient which is still faster since it can > take advantage of the 64-bit processor instruction set. Ken, I was really looking for some tests that show both of the above were true. We've had some trouble proving the claims of other algorithms before, so I'm less inclined to take those things at face value. I'd suggest tests with Integers, BigInts, UUID, CHAR(20) and CHAR(100). Others may have different concerns. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com