Home » RDBMS Server » Performance Tuning » Index usage
Index usage [message #387679] Fri, 20 February 2009 04:56 Go to next message
deepak samal
Messages: 29
Registered: February 2005
Junior Member

I have a query like select * from t1 where col1 = 1 and col2 between 1 and 9999.

I have an unique index on T1(col1, col2). But as i am using 'BETWEEN' in my query, my index is not using the col2. It is going for 1 column hit.

instead of 'BETWEEN' i also tried with <= and >= as (select * from t1 where col1 >= 1 and col2 <= 9999) but this also does not help out. Still this is a single column hit. Col2 is not used in my index.

Is there any alternate for 'BETWEEN' clause. How can i improve the performance of this query? How can i best use my index?


[Updated on: Fri, 20 February 2009 05:03]

Report message to a moderator

Re: Index usage [message #387711 is a reply to message #387679] Fri, 20 February 2009 06:27 Go to previous messageGo to next message
Michel Cadot
Messages: 65087
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Usual and required information are missing.

Re: Index usage [message #387853 is a reply to message #387711] Fri, 20 February 2009 21:19 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Take a look at this link

Ross Leishman
Previous Topic: Execution Plan (merged)
Next Topic: tuning
Goto Forum:

Current Time: Tue Jul 25 10:17:18 CDT 2017

Total time taken to generate the page: 0.50472 seconds