Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 21B04B5DC1A for ; Thu, 13 Oct 2011 16:51:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 47303-03 for ; Thu, 13 Oct 2011 19:50:55 +0000 (UTC) X-Greylist: delayed 00:16:45.456918 by SQLgrey-1.8.0-rc2 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id 338B2B5D803 for ; Thu, 13 Oct 2011 16:50:55 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RER2f-0002EZ-0A for pgsql-performance@postgresql.org; Thu, 13 Oct 2011 12:34:09 -0700 Date: Thu, 13 Oct 2011 12:34:09 -0700 (PDT) From: davidsarmstrong To: pgsql-performance@postgresql.org Message-ID: <1318534448999-4900348.post@n5.nabble.com> In-Reply-To: <4E13A9C2.9000906@kc8onw.net> References: <4E13A9C2.9000906@kc8onw.net> Subject: Re: Slow query when using ORDER BY *and* LIMIT MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.963 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FORGED_YAHOO_RCVD=1.63, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201110/133 X-Sequence-Number: 45355 I'm running into the same problem. I removed the limit and it was fine. I guess I could have removed the order by as well but it doesn't help if you really need both. Have you found any more information on this? Thanks! Dave (Armstrong) -- View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-query-when-using-ORDER-BY-and-LIMIT-tp4555260p4900348.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com.