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 6CCDED1D08B for ; Mon, 19 Apr 2004 09:05:26 -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 75036-09 for ; Mon, 19 Apr 2004 09:05:27 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 43A74D1D08C for ; Mon, 19 Apr 2004 09:05:23 -0300 (ADT) Received: (qmail 8053 invoked from network); 19 Apr 2004 12:05:19 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 19 Apr 2004 12:05:19 -0000 Subject: Re: Horribly slow hash join From: Dave Cramer Reply-To: pg@fastcrypt.com To: Tom Lane Cc: Greg Stark , Dennis Bjorklund , Bruno Wolff III , "Jim C. Nasby" , pgsql-performance@postgresql.org In-Reply-To: <16041.1082354970@sss.pgh.pa.us> References: <874qrg7cy8.fsf@stark.xeocode.com> <16041.1082354970@sss.pgh.pa.us> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1082376464.1558.69.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 19 Apr 2004 08:07:44 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/265 X-Sequence-Number: 6565 Here's an interesting link that suggests that hyperthreading would be much worse. http://groups.google.com/groups?q=hyperthreading+dual+xeon+idle&start=10&hl=en&lr=&ie=UTF-8&c2coff=1&selm=aukkonen-FE5275.21093624062003%40shawnews.gv.shawcable.net&rnum=16 FWIW, I have anecdotal evidence that suggests that this is the case, on of my clients was seeing very large context switches with HTT turned on, and without it was much better. Dave On Mon, 2004-04-19 at 02:09, Tom Lane wrote: > Greg Stark writes: > > If the hash tables were made a power of two then it would be possible to mix > > the bits of the 32 bit value and just mask off the unneeded bits. I've found > > one page via google that mentions mixing bits in a hash function, but I would > > look for a more serious treatment somewhere. > > http://burtleburtle.net/bob/hash/doobs.html > > Incidentally, this text claims mod is extremely slow compared to bit > > manipulations. > > Modding by a *non* power of 2 (esp. a prime) mixes the bits quite well, > and is likely faster than any multiple-instruction way to do the same. > > The quoted article seems to be by someone who has spent a lot of time > counting assembly cycles and none at all reading the last thirty years > worth of CS literature. Knuth's treatment of hashing has some actual > math to it... > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > > > !DSPAM:40837183123741526418863! > > -- Dave Cramer 519 939 0336 ICQ # 14675561