sql server - Nonclustered index with include vs nearly same Nonclustered index without; Multiple query coverage -
i have 2 existing indices in db below
create nonclustered index indextable1 on table (fkanothertable)
create nonclustered index indextable2 on table (fkanothertable) include (pktable)
i had hunch , research seems point queries call #1 satisfied #2 , #1 wasteful. couldn't find definitive answer though.
is assumption correct , can drop #1 , potentially improve performance?
yes. #2 entirely covers #1 , possibly vice-versa in fact. pktable
clustered index key? if included in #1 (at key level because non clustered index not declared unique).
if pktable
not clustering key queries seeking on #1
still satisfied #2
#2
may occupy more pages making scans have used #1
tad less efficient.
Comments
Post a Comment