X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 551F7D7E0D for ; Sat, 27 Aug 2005 00:03:50 -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 98219-03 for ; Sat, 27 Aug 2005 03:03:48 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id 67074D7E08 for ; Sat, 27 Aug 2005 00:03:47 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1E8qyg-0006zX-00; Fri, 26 Aug 2005 23:03:30 -0400 To: Tom Lane Cc: Mark Kirkwood , Tobias Brox , pgsql-performance@postgresql.org Subject: Re: Limit + group + join References: <20050826002709.GK10328@tobias.lan> <430E85ED.60109@paradise.net.nz> <9501.1125071193@sss.pgh.pa.us> In-Reply-To: <9501.1125071193@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 26 Aug 2005 23:03:30 -0400 Message-ID: <87mzn484jh.fsf@stark.xeocode.com> Lines: 14 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 hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200508/467 X-Sequence-Number: 14214 Tom Lane writes: > As far as the "desc" point goes, the problem is that mergejoins aren't > capable of dealing with backward sort order, so a merge plan isn't > considered for that case (or at least, it would have to have a sort > after it, which pretty much defeats the point for a fast-start plan). > I have some ideas about fixing this but it won't happen before 8.2. Of course in this case assuming "id" is an integer column you can just sort by -id instead. -- greg