REgarding the article publish in sqlservercentrl on t-sql performance tunining Part -2 which is an extract from this book....
1.It says on p12, by adding anotther constraint( p.productid = s.productid) in the where clause you get a perfomace boost. If SQL server doesn't know A=c when A=B and B=C, then sql has to check this which means an added overhead(redundant) to the the query. In my experiecnce I have removed lot of this type redunant filterations which boosted performance(opposite to the argument)
2. When using OR replacing with UNION queries..
this again if you have or statements in one query, when sql evaluates from left to right, the first neagative condition will end the checking. But as you indicate, irrespective of results, sql has to evaluvate for all coditions in the OR clause.
|