Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 485ED2E2A35 for ; Mon, 17 Mar 2008 09:57:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 82273-01-9 for ; Mon, 17 Mar 2008 09:57:48 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.204.176]) by postgresql.org (Postfix) with ESMTP id AC8FB2E2F49 for ; Mon, 17 Mar 2008 09:34:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from is.rice.edu (is.rice.edu [128.42.42.24]) by mx1.hub.org (Postfix) with ESMTP id CCEAE16D965D for ; Mon, 17 Mar 2008 09:33:32 -0300 (ADT) Received: from scan1.mail.rice.edu (scan1.mail.rice.edu [128.42.58.160]) by is.rice.edu (Postfix) with ESMTP id 4F5564182E; Mon, 17 Mar 2008 07:28:31 -0500 (CDT) Received: from is.rice.edu ([128.42.42.24]) by scan1.mail.rice.edu (scan1.mail.rice.edu [128.42.58.160]) (amavisd-new, port 10024) with ESMTP id 28222-06; Mon, 17 Mar 2008 06:28:30 -0600 (CST) Received: by is.rice.edu (Postfix, from userid 18612) id 93DC941820; Mon, 17 Mar 2008 07:28:30 -0500 (CDT) Date: Mon, 17 Mar 2008 07:28:30 -0500 From: Kenneth Marshall To: Tom Lane Cc: pgsql-patches@postgresql.org, twraney@comcast.net, neilc@samurai.com Subject: Re: updated hash functions for postgresql v1 Message-ID: <20080317122828.GA1643@it.is.rice.edu> References: <20071027201557.GW27320@it.is.rice.edu> <21779.1205722382@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21779.1205722382@sss.pgh.pa.us> User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: by amavis-2.2.1 at scan1.mail.rice.edu X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/225 X-Sequence-Number: 5288 On Sun, Mar 16, 2008 at 10:53:02PM -0400, Tom Lane wrote: > Kenneth Marshall writes: > > Dear PostgreSQL Developers, > > This patch is a "diff -c" against the hashfunc.c from postgresql-8.3beta1. > > It's pretty obvious that this patch hasn't even been tested on a > big-endian machine: > > > + #ifndef WORS_BIGENDIAN > > However, why do we need two code paths anyway? I don't think there's > any requirement for the hash values to come out the same on little- > and big-endian machines. In common cases the byte-array data being > presented to the hash function would be different to start with, so > you could hardly expect identical hash results even if you had separate > code paths. > > I don't find anything very compelling about 64-bit hashing, either. > We couldn't move to that without breaking API for hash functions > of user-defined types. Given all the other problems with hash > indexes, the issue of whether it's useful to have more than 2^32 > hash buckets seems very far off indeed. > > regards, tom lane > Yes, there is that typo but it has, in fact, been tested on big and little-endian machines. Since, it was a simple update to replace the current hash function used by PostgreSQL with the new version from Bob Jenkins. The test for the endian-ness of the system allows for the code paths to be optimized for the particular CPU. The 64-bit hashing was included for use during my work on on the hash index. Part of that will entail testing the performance of various permutations of previously submitted suggestions. Regards, Ken Marshall