On Mon, Jun 13, 2005 at 11:46:46 -0500,
Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
> 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.
I suspect that this isn't a big deal. There was a question like that
that has been going back and forth over the last couple of days.
If you remove the constant expression from the index, you aren't likely
going to use the index anyway, but will instead sort the output rows
from either a sequential scan or an index scan based on an index
that does use the constant expression.