Re: [BUGS] I have a question about using index in order statement.

2007-11-02 Thread Heikki Linnakangas
Tom Lane wrote: The basic reason that there's a problem here is that the parser is playing fast and loose by generating ORDER BY information that cites "text < text" as the sort operator but applies it to a bare varchar Var node. So I thought about a Plan B of changing the parser to put a correc

Re: [BUGS] I have a question about using index in order statement.

2007-11-02 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> 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 > RelabelTy

Re: [BUGS] I have a question about using index in order statement.

2007-11-02 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Attached is a patch that fixes that test case. I'm not very familiar > with that piece of code, though, and I have a sneaking suspicion that > the patch is either not general enough, there may be other places where > we should ignore relabel nodes

Re: [BUGS] I have a question about using index in order statement.

2007-11-02 Thread Heikki Linnakangas
kevin wrote: Question: I have a question about using index in order statement. Why index ix_2 work by Seq Scan and index ix_3 work by Index Scan. Example : ix_2 condition : When I try explain select * from a_test order by code_ desc Postgresql response Sort (cost=11815.08..10