X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2BE5AD1B2A6 for ; Wed, 21 Jul 2004 07:04:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34019-05 for ; Wed, 21 Jul 2004 10:04:13 +0000 (GMT) Received: from trofast.sesse.net (trofast.sesse.net [129.241.93.32]) by svr1.postgresql.org (Postfix) with ESMTP id 8C9A3D1B1BE for ; Wed, 21 Jul 2004 07:04:09 -0300 (ADT) Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1BnDxK-0006yz-00 for ; Wed, 21 Jul 2004 12:04:10 +0200 Date: Wed, 21 Jul 2004 12:04:10 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Odd sorting behaviour Message-ID: <20040721100410.GC26552@uio.no> References: <20040708101913.GA15871@uio.no> <20040715120854.GA31259@uio.no> <20040720115116.GB19633@uio.no> <200407201006.08649.josh@agliodbs.com> <20040720172100.GA22262@uio.no> <1090376297.12565.9.camel@jester> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1090376297.12565.9.camel@jester> X-Operating-System: Linux 2.6.6 on a i686 User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/140 X-Sequence-Number: 7531 On Tue, Jul 20, 2004 at 10:18:19PM -0400, Rod Taylor wrote: > I've taken a look and managed to cut out quite a bit of used time. > You'll need to confirm it's the same results though (I didn't -- it is > the same number of results (query below) It looks very much like the same results. > Secondly, I had no luck getting the hashjoin but this probably doesn't > matter. I've assumed that the number of users will climb faster than the > product set offered, and generated additional data via the below command > run 4 times: Actually, the number of users won't climb that much faster; what will probably increase is the number of opinions. > I found that by this point, the hashjoin and mergejoin have essentially > the same performance -- in otherwords, as you grow you'll want the > mergejoin eventually so I wouldn't worry about it too much. Hm, OK. > -- Plain join okay since o12.correlation <> 0 > -- eliminates any NULLs anyway. > -- Was RIGHT JOIN OK, that makes sense (although I don't really see why it should be faster). > -- Was old Left join > WHERE o3.prodid NOT IN (SELECT prodid > FROM opinions AS o4 > WHERE uid = 1355) As my server is 7.2 and not 7.4, that obviously won't help much :-) Thanks anyway, though -- we'll upgrade eventually, and it'll help then. /* Steinar */ -- Homepage: http://www.sesse.net/