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 C817E528AB for ; Wed, 18 May 2005 12:07:06 -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 47488-10 for ; Wed, 18 May 2005 15:06:56 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id ABF94528C1 for ; Wed, 18 May 2005 12:06:54 -0300 (ADT) Received: (qmail 32481 invoked from network); 18 May 2005 17:07:18 +0200 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 18 May 2005 17:07:18 +0200 To: =?utf-8?B?U3rFsWNzIEfDoWJvcg==?= , "pgsql-performance@postgresql.org" Subject: Re: where+orderby+limit not (always) using appropriate index? References: <428B5179.6060202@gmail.com> Message-ID: Date: Wed, 18 May 2005 17:06:51 +0200 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <428B5179.6060202@gmail.com> User-Agent: Opera M2(BETA2)/8.0 (Linux, build 987) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/313 X-Sequence-Number: 12477 > SELECT o FROM t WHERE i = 1 ORDER BY o LIMIT 1; use : ORDER BY i, o If you have a multicol index and want to order on it, you should help the planner by ORDERing BY all of the columns in the index... It bit me a few times ;)