X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 00F05D1DC7D for ; Sun, 18 Apr 2004 03:43:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48056-03 for ; Sun, 18 Apr 2004 03:43:10 -0300 (ADT) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id 436D0D1D300 for ; Sun, 18 Apr 2004 03:43:09 -0300 (ADT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id D9A7417C144; Sun, 18 Apr 2004 02:43:09 -0400 (EDT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1BF61F-0006Mm-00; Sun, 18 Apr 2004 02:43:09 -0400 To: Tom Lane Cc: Greg Stark , "Jim C. Nasby" , pgsql-performance@postgresql.org Subject: Re: Horribly slow hash join References: <20040416154502.GF87362@nasby.net> <450.1082133251@sss.pgh.pa.us> <20040416164644.GH87362@nasby.net> <808.1082135098@sss.pgh.pa.us> <20040416172523.GJ87362@nasby.net> <1263.1082138383@sss.pgh.pa.us> <20040416184541.GK87362@nasby.net> <10603.1082218095@sss.pgh.pa.us> <878ygu8auw.fsf@stark.xeocode.com> <15053.1082259958@sss.pgh.pa.us> In-Reply-To: <15053.1082259958@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 18 Apr 2004 02:43:09 -0400 Message-ID: <873c719476.fsf@stark.xeocode.com> Lines: 23 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/242 X-Sequence-Number: 6542 Tom Lane writes: > Greg Stark writes: > > Tom Lane writes: > >> (Also, I have been harboring some notions of supporting cross-type hash > >> joins for integer types, which will not work unless small int8 values hash > >> the same as int4 etc.) > > > The obvious way to modify the hash function is to xor the high 32 bits with > > the low 32 bits. That maintains the property you need > > No it doesn't ... Eh? Oh, negative numbers? So low^high^sign. I wonder if it makes sense to have check the hash distribution after generating the table and if it's bad then throw it away and try again with a different hash function. The "different hash function" would probably just be a seed value changing. Probably way overkill though. -- greg