由于糟糕的 SSIS 包设计,执行势必会很慢。请参考文档SSIS 设计的最佳实践
让我向您解释一下您的包裹中存在的错误。
1.您正在使用阻塞转换(排序组件)。这些转换不会重用输入缓冲区,而是为输出创建一个新的缓冲区,并且大多数情况下它们比尝试重用的同步组件(例如查找、派生列等)慢输入缓冲区。根据 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 Joinsemi-blocking transformation
确实会影响性能,但远低于Blocking transformation
有两种方法可以解决问题
- 使用查找
使用执行 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);