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 B1FB6528BF for ; Mon, 13 Jun 2005 13:47:05 -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 70185-01 for ; Mon, 13 Jun 2005 16:47:01 +0000 (GMT) Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.91]) by svr1.postgresql.org (Postfix) with ESMTP id 7FCF6528AA for ; Mon, 13 Jun 2005 13:46:59 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Mon, 13 Jun 2005 11:46:58 -0500 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Date: Mon, 13 Jun 2005 11:46:46 -0500 From: "Kevin Grittner" To: , Cc: , , , Subject: Re: Index ot being used Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.032 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/302 X-Sequence-Number: 12939 I agree that ignoring useless columns in an ORDER BY clause is less important than ignoring index columns where the value is fixed. There is one use case for ignoring useless ORDER BY columns that leaps to mind, however -- a column is added to the ORDER BY clause of a query to help out the optimizer, then the indexes are modified such that that column is no longer useful. Whether this merits the programming effort and performance hit you describe seems highly questionable, though. -Kevin >>> Tom Lane 06/13/05 11:22 AM >>> 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?