April 21, 2007

Validate Your Refactored SQL Queries with a New SQL Server 2005 Operator

s a developer, how often have you been asked to refactor a SQL statement to increase performance, accommodate changes to database design, support a new database, or for a whole host of other reasons? Often you need to do the refactoring without affecting the results. When you refactor a query

Predicate Pushing

Oracle supports the pushing of predicates into a given view. Suppose you have a set of layered views: –View OneCREATE VIEW vw_layer_oneAS SELECT * FROM emp;– View TwoCREATE VIEW vw_layer_two_dept_100AS SELECT * FROM vw_layer_oneWHERE deptno=100; Then assume you issued this query: SELECT * FROM vw_layer_two_dept_100WHERE empid=100; The predicate in this