I have a query like this:
SELECT *
FROM T
WHERE A = @A AND (B=@B OR C=@C OR D=@D OR @E=E)
ORDER BY F
What indices should I add to improve query performance? Also I'll need to implement paging so this query will be more complex.
My guess is that four indices should be created: (A, B, F), (A, C, F), (A, D, F) (A, E, F), but I'm not sure and can't really test it as I don't have enough data yet.
Does anyone have some experience to share? Thanks.