I have an SQL query (generated by LINQ to Entities) which is roughly like the following:
SELECT * FROM [mydb].[dbo].[employees]
JOIN [mydb].[dbo].[industry]
What order are the fields in the clustered index included in? You'll want to put the startDateTime
field first in order for the ORDER BY
to match it, or in this case (countryId, startDateTime)
up front in that order since you want to select a single countryId
(indirectly, via countryName
) and then order by startDateTime
.