Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-06-16 : 04:34:00
|
| Hi ,Iam just checking whether which index is called while executing the below query:set showplan_text onSelect * from tester where age>25Table Structure[Tester]:Sno int,name varchar(25),age intClustered index on sno [index name:cid_test ]non clustered index on age [index name:ind_te_age]index called is cid_testMy doubt is actually is should call ind_te_age |
|
|
pootle_flump
1064 Posts |
Posted - 2008-06-16 : 07:00:49
|
| Not if you use "SELECT *". You will get a clustered index scan. The only way you will use an index on age for that query is if:The non clustered index covers the queryAge is the first column in the clustered index keyThe query returns around 3% or less of the table |
 |
|
|
|
|
|