indexing - SQL Server non-clustered Index never shows up in execution plan -
i have database table called tbl_event
non-clustered indexes idx_event_folder
, idx_event_time
defined as:
create nonclustered index [idx_event_folder] on [dbo].[tbl_event]([nobjectid] asc) create nonclustered index [idx_event_time] on [dbo].[tbl_event]([tetime] asc)
i ran following simple queries , got execution plans displayed directly underneath:
query 1:
select * tbl_event tbl_event.nobjectid = 1410000 order tetime
query 2:
select * tbl_event tbl_event.nobjectid = 1410000
my question is, why index on nobjectid never utilized? expect there index seek or scan when nobjectid specified in clause of these select statements. understanding of analysis incorrect?
you in comments there 18325170 rows in table, 30 of them have nobjectid=1410000.
even if idx_event_folder
index disabled cannot believe sql server choose plan amount of rows , line thickness indicates thinks dealing maybe 1 row not 18325170!
so i'm pretty sure must have auto update statistics disabled? if need update statistics manually (or preferably enable option)
Comments
Post a Comment