Originally posted by: trans53
where columnDate > 'datetime' and columnDate < 'datetime'
and column1 = 'userid'
test table have 2 non-clustered indexes (One defined on columnDate and another on column1).
The index based on columnDate field is not very selective.
If this is a frequently executed query, you should consider clustered index in columnDate.
Optimizer makes its decision based on the availabe info which is subject to change in a dynamic table.
Kalman Toth - Database, Data Warehouse & Business Intelligence Architect
SQL Server 2005 Training, SSAS, SSIS, SSRS: http://www.sqlusa.com/