If you have a composite clustered index say: (ClientId, Date, OrderId, ProductId)
. (All fields are non-null)
Given the query:
SELECT * FROM products WHERE ClientId = 33 AND OrderId = 4 AND ProductId = 2 ORDER BY Date
Will this query take advantage of the covering index fully by having the ORDER BY Date
or does it require that the Date
field be in the WHERE clause?
I added tags of the main database engines, in case there is discrepancy between each.