Sample Header Ad - 728x90

Non clustered index not used

0 votes
1 answer
130 views
I have the following tables: - User that has a non clustered Index on UserName and Active columns. - Notification that has a non clustered index on the UserId I don't understand why in the first situation the non-clustered index on the username is used, but non in the second: Non clustered index being used Non clustered index not being used I expected for the second situation, that SQL will do a non clustered index seek on the User table, then a Clustered Index Seek on the Notification table. Link to the execution plan: https://www.brentozar.com/pastetheplan/?id=HyG1Kwm1h The IX_UserName index is defined as *unique* and it's also filtered on Active = 1.
Asked by Norbert Forgacs (101 rep)
Mar 6, 2023, 11:23 AM
Last activity: Mar 6, 2023, 01:56 PM