Help needed to understand the query behaviour.
I have a requirement to do a "select * from tab_A order by col1,col12,col23,col34". Please note there is no 'where' clause and I have to read the full table. Some of the columns in the 'order by' clause are defined as 'NULL'.
The table tab_A is quite big(approx 1G).
In the above situation, the query is making a full table scan and taking a long time where there is no composite index. When I create a composite b-tree index on the 4 columns in order by clause, the response is very good. However, even with the index, the optimizer is using it only when I use the hint and not other wise.