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 B942152809 for ; Mon, 13 Jun 2005 12:39:59 -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 53801-01 for ; Mon, 13 Jun 2005 15:39:51 +0000 (GMT) Received: from ylpvm12.prodigy.net (ylpvm12-ext.prodigy.net [207.115.57.43]) by svr1.postgresql.org (Postfix) with ESMTP id C88D552813 for ; Mon, 13 Jun 2005 12:39:49 -0300 (ADT) Received: from pimout6-ext.prodigy.net (pimout6-int.prodigy.net [207.115.4.22]) by ylpvm12.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j5DFdmG4024296 for ; Mon, 13 Jun 2005 11:39:48 -0400 X-ORBL: [69.177.163.214] Received: from [192.168.1.207] (214.adsl.snet.net [69.177.163.214] (may be forged)) by pimout6-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id j5DFddhe128714; Mon, 13 Jun 2005 11:39:43 -0400 Message-ID: <42ADAA92.7000200@kencast.com> Date: Mon, 13 Jun 2005 11:47:30 -0400 From: Wei Weng User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Alex Stapleton , pgsql-performance@postgresql.org Subject: Re: PostgreSQL using the wrong Index References: <2D1A68BF-B3A4-490E-8053-3CF6626B8DAF@advfn.com> <19854.1118674492@sss.pgh.pa.us> In-Reply-To: <19854.1118674492@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.195 tagged_above=0 required=5 tests=AWL, RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: * X-Archive-Number: 200506/296 X-Sequence-Number: 12933 Tom Lane wrote: > > > This was just covered in excruciating detail yesterday ... > > You need to write > order by symbol desc, time desc limit 1 > to get the planner to recognize the connection to the sort order > of this index. Since you're only selecting one value of symbol, > the actual output doesn't change. > Is this the right behavior (not a bug)? Is postgresql planning on changing this soon? Thanks Wei