Database Tuning (MOSC)

MOSC Banner

Help needed to understand the query behaviour.

edited Aug 5, 2009 2:35AM in Database Tuning (MOSC) 9 commentsAnswered ✓
 Hi,

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.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center