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
Hi

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?

Thanks
Deepak

[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: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Usual and required information are missing.

Regards
Michel
Re: Index usage [message #387853 is a reply to message #387711] Fri, 20 February 2009 21:19 Go to previous message
rleishman
Messages: 3728
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: Fri Jun 28 01:17:05 CDT 2024