-2

I have 2 columns: Name and Price.

Price is a computed column which call a function to calculate the price with some queries.

Now I want to know is there any difference between :

select * 
from myTable 
where name like 'j%' and Price > 1000

and

select * 
from myTable 
where Price > 1000 and name like 'j%'

I want to know if I use name like 'j%' at first does it have better performance because maybe sql server does not check the computed column at first for all records ?

Sepehr Estaki
  • 331
  • 5
  • 19

1 Answers1

0

Absolutely no difference at all. The query engine will evaluate those in whatever order it feels will provide the best option for retrieval. It doesn't matter the order of predicates nor the order of values in each predicate.

Sean Lange
  • 33,028
  • 3
  • 25
  • 40