All
I have a table which has 30 Million rows and my developer has created a SP which queries the 30 Million row table. The query is
select count(*)
from Tablename(nolock)
where typeid = 1
and ((transstatusid = 1) or (transstatusid is null))
and responsetime >= @currenttime_Start and responsetime < @CurrentTime_end
I have created a composite index for the table as follows:
index name :idx_hourlytrans
index : nonclustered located on PRIMARY
Indexed Columns : TypeID, TransStatusID, ResponseTime
Whenever i run an estimated Execution Plan for the above query it goes for an Index SCAN on this table.This query takes about 2 minutes to run.
Please let me know what should i do so that i can eliminate the Index Scan and go for Index Usage.
Sen
I have a table which has 30 Million rows and my developer has created a SP which queries the 30 Million row table. The query is
select count(*)
from Tablename(nolock)
where typeid = 1
and ((transstatusid = 1) or (transstatusid is null))
and responsetime >= @currenttime_Start and responsetime < @CurrentTime_end
I have created a composite index for the table as follows:
index name :idx_hourlytrans
index : nonclustered located on PRIMARY
Indexed Columns : TypeID, TransStatusID, ResponseTime
Whenever i run an estimated Execution Plan for the above query it goes for an Index SCAN on this table.This query takes about 2 minutes to run.
Please let me know what should i do so that i can eliminate the Index Scan and go for Index Usage.
Sen