sql server - Nonclustered index with include vs nearly same Nonclustered index without; Multiple query coverage -


i have 2 existing indices in db below

  1. create nonclustered index indextable1 on table (fkanothertable)

  2. 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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -