Re: I have a question about using index in order statement. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: I have a question about using index in order statement.
Date
Msg-id 11811.1194024867@sss.pgh.pa.us
Whole thread Raw
In response to Re: I have a question about using index in order statement.  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-bugs
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> Tom Lane wrote:
>> I guess the right answer is to fix equivclass.c to strip RelabelTypes,
>> and hope to maybe take that out again someday when all this gets cleaned
>> up.

> That certainly looks like the easier solution. We still strip
> RelabelTypes in many places anyway, so doing it in one more place
> doesn't seem too bad to me.

I reconsidered this after further thought.  If we do that it'd also mean
that clauses generated from EquivalenceClasses don't have RelabelType,
which is definitely going in the wrong direction in a big way.

What I'm just about to experiment with is the idea that lines 498-517
of pathkeys.c are in the wrong place: that should be done within
make_pathkey_from_sortinfo, so that it would also happen for expressions
coming from SortClauses (see the other caller of
make_pathkey_from_sortinfo).  Then the expressions coming in to
equivclass.c should always match.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: tsvector that can't be dumped/reloaded in 8.3beta
Next
From: "Radim Kolar"
Date:
Subject: BUG #3714: applications using COPY are now much slower