Tag Info

New answers tagged


It depends on the commodity of the query. Being extra specific should never hurt in this instance, but for something that simple the query planner in SQL Server will be bright enough to imply either o.OrderID = @xorderid or od.OrderID = @xorderid from the other because of o.OrderID = od.OrderID so you should not need to specify both. Of course other ...


The best way to determine this is to simply look at the execution plans. Typically the optimizer will "condense" a lot of the operations in a query down. For example, if you include "WHERE 1=0" in your query it will see that, know it to be false, and do as little work as possible to return an empty set. In fact, in this case, it does 0 I/O operations as far ...

Top 50 recent answers are included