andybellenie (8/1/2013)
CREATE UNIQUE CLUSTERED INDEX [IX_campaignContacts] ON [dbo].[campaignContacts](
campaignId ASC,
contactId ASC
)
The index you created above would be used if you had a statement like this:
SELECT contactId
FROM campaignContacts
WHERE campaignId = @p1
AND contactId = @p2
so the index specifically supports WHERE statements..
if you don't have a WHERE statement, the optimizer would ignore that index, and use something different.
does that help?
Lowell