执行绑定,因为差SSIS包设计的要慢。 请参考文档Best Practices of SSIS Design
让我来解释一下包装中存在的错误。
1.您正在使用Blocking转换(Sort Component)。这些转换不会重用输入缓冲区,而是为输出创建一个新缓冲区,并且大多数情况下它们比同步组件(如查找,派生列等等)重新使用输入缓冲区。 按照MSDN
Do not sort within Integration Services unless it is absolutely necessary. In
order to perform a sort, Integration Services allocates the memory space of the
entire data set that needs to be transformed. If possible, presort the data before
it goes into the pipeline. If you must sort data, try your best to sort only small
data sets in the pipeline. Instead of using Integration Services for sorting, use
an SQL statement with ORDER BY to sort large data sets in the database – mark
the output as sorted by changing the Integration Services pipeline metadata
on the data
source.
2.Merge加入是semi-blocking transformation
这确实阻碍性能,但远低于Blocking transformation
有2种方式中,就可以解决这个问题
- 使用Lookup
使用执行SQL任务和写入合并SQL
DECLARE @T TABLE(ID INT);
Merge @TableA as target
using @TableB as source
on target.ID=source.ID
when matched then
Delete OUTPUT source.ID INTO @T;
DELETE @TableA
WHERE ID in (SELECT ID
FROM @T);