Hi everyone

 

I’m pretty sure you already know that, but anyway:

 

I tested today if the MS SQL Server’s Query Optimizer is smart enough, so it 
seems it is. There is no difference in executions plans for these two queries:

 

Select * From table1 Where Name Like ‘%’ Order By Name

 

And

 

Select * From table1

 

It seems it figures I want all the records and simply removes the where from 
the query. The good thing is I can always write LIKE parameterized queries, and 
if I need some of the records, I send the parameter; if I need them all, I send 
‘%’ and there will no performance penalty.



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to