I have an association table that looks like this: CREATE TABLE ClubMember ( PK uniqueidentifier NOT NULL, ClubFK uniqueidentifier NOT NULL, PersonFK uniqueidentifier NOT NULL, CONSTRAINT [PK_ClubMember] PRIMARY KEY NONCLUSTERED (PK) )
The table contains about ten million rows. I want to query it like this: select PersonFK from ClubMember where ClubFK = '7130DF7E-4045-437C-A383-A936C0671746'
It seems to me that the best way to maximize performance of this query is to create a clustered index that contains both ClubFK and PersonFK: create unique clustered index IX_ClubMember on ClubMember ( ClubFK, PersonFK )
However, when I create the index and then run the query through the tuning advisor, it recommends that I instead create a non-clustered index on ClubFK that also "includes" PersonFK: create nonclustered index IX_ClubMember on ClubMember ( ClubFK ) include (PersonFK)
Can anyone explain why the second index is faster than the first? It seems to me that nothing could be faster than a physically clustered index with columns that cover the entire query. Thanks.-- Brian