Push-Into Optimization with the SQL Transformation Example
Push-Into Optimization with the SQL Transformation Example
An SQL transformation retrieves orders by customer ID. A Filter transformation that appears after the SQL transformation returns only the rows where the order amount is greater than 1000.
The Data Integration Service pushes the following filter into a SELECT statement in the SQL transformation:
orderAmount > 1000
Each statement in the SQL query becomes a separate subquery of the SELECT statement that contains the filter.
The following query statement shows the original query statement as a subquery in the SELECT statement:
SELECT <customerID>, <orderAmount>, … FROM (
original query statements
) ALIAS WHERE <orderAmount> > 1000
If the SQL query has multiple statements, each statement is included in a separate subquery. The subquery has the same syntax, including the WHERE clause.
The ports
customerID
and
orderAmount
, are the names of the output ports in the SQL transformation. The subquery does not include pass-through ports, the SQL error, or the SQL statistics ports. If you push multiple filters into the SQL transformation, the WHERE clause contains all the filters.