X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D20A99F9B01 for ; Thu, 25 May 2006 18:08:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 34378-04 for ; Thu, 25 May 2006 18:08:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 0A7389F94EA for ; Thu, 25 May 2006 18:08:47 -0300 (ADT) Received: from trofast.ipv6.sesse.net ([2001:700:300:dc03:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1FjN4X-0007Nd-8C for pgsql-performance@postgresql.org; Thu, 25 May 2006 23:08:46 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1FjN4c-0005Ho-00 for ; Thu, 25 May 2006 23:08:50 +0200 Date: Thu, 25 May 2006 23:08:50 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: is it possible to make this faster? Message-ID: <20060525210850.GA20274@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <20060525203630.GA19881@uio.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Operating-System: Linux 2.6.16.11 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11+cvs20060403 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/478 X-Sequence-Number: 19265 On Thu, May 25, 2006 at 04:54:09PM -0400, Merlin Moncure wrote: >> select a,b,(select c from t t2 order by c desc where t1.a=t2.a and >> t1.b=t2.b) >> from t t1 group by a,b; > this came out to a tie with the group by approach, although it > produced a different (but similar) plan. we are still orders of > magnitude behind mysql here. Actually, it _should_ produce a syntax error -- it's missing a LIMIT 1 in the subquery. /* Steinar */ -- Homepage: http://www.sesse.net/