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 22CEB528B2 for ; Mon, 13 Jun 2005 13:50:09 -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 68350-08 for ; Mon, 13 Jun 2005 16:50:04 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id 08F1C52889 for ; Mon, 13 Jun 2005 13:50:03 -0300 (ADT) Received: (qmail 13455 invoked by uid 500); 13 Jun 2005 16:49:29 -0000 Date: Mon, 13 Jun 2005 11:49:29 -0500 From: Bruno Wolff III To: Tom Lane Cc: John A Meinel , Kevin Grittner , linux@alteeve.com, tobias@nordicbet.com, pgsql-performance@postgresql.org Subject: Re: Index ot being used Message-ID: <20050613164929.GA12557@wolff.to> Mail-Followup-To: Bruno Wolff III , Tom Lane , John A Meinel , Kevin Grittner , linux@alteeve.com, tobias@nordicbet.com, pgsql-performance@postgresql.org References: <42AD9D8D.9060503@arbash-meinel.com> <20050613154834.GA9203@wolff.to> <20542.1118679734@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20542.1118679734@sss.pgh.pa.us> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/303 X-Sequence-Number: 12940 On Mon, Jun 13, 2005 at 12:22:14 -0400, Tom Lane wrote: > > I don't think the use-case has been shown that justifies doing this much > work to ignore useless ORDER BY clauses. The examples that have come up > in the past all suggest ignoring index columns not the other way 'round. > Can you make a case that we need to do that part of it? I don't think so. I don't think people are likely to order by constant expressions except by adding them to the front to help optimization. When I was thinking about this I was looking at what equivalences could be used and didn't look back to see which ones would be useful in the normal case. And I think it is a lot more likely people will leave out columns they know not to be relevant than to include them.