Skip to main content
2 of 3
added 370 characters in body
Jack Douglas
  • 40.6k
  • 16
  • 106
  • 181

No, you can specify the 'params' (the parts of the where clause) in any order and the query optimizer will handle it.

You can't exactly prove this, but you can demonstrate it is true for a particular query by experimenting and seeing if the plan changes. It may even be true that there are edge cases where the order does matter, but my advice would be to ignore the possibility and assume it never happens as otherwise you will expend a lot of effort trying different permutations. Much better to focus on the kind of tuning which you know can pay dividends (eg correct indexing).

Jack Douglas
  • 40.6k
  • 16
  • 106
  • 181