Weeeeeeelllllllll that's true if you are ordering by a numeric or date, but don't forget that the index order is ASCII for char and varchar2, wheras the linguistic sort order is not.Originally posted by pando
Have you analyzed the table? Optimizer is clever enough to bypass your order by clause if it's using an indexed column
For example ...
An index is not going to give the correct order here.Code:SQL> alter session set nls_sort = 'FRENCH'; SQL> / SQL> select * from my_table order by my_col; M - A a B b E e
However ...
Here an index is going to help.Code:SQL> alter session set nls_sort = 'BINARY'; SQL> / SQL> select * from my_table order by my_col; M - A B E a b e
realistically, this means that if you only have either upper or lower case characters in each of your order by char columns, then setting nls_sort to binary will allow the optimizer to use an index to satisfy the order by clause




Reply With Quote