简体   繁体   English

执行 SSIS 任务验证时间过长

[英]Executing SSIS task taking too long to validate

I have an SSIS data flow task that is taking almost 20 minutes to validate upon execution.我有一个 SSIS 数据流任务,在执行时需要将近 20 分钟来验证。 This is whether I'm running directly in VS, or executing the package from SSMS.这是我是直接在 VS 中运行,还是从 SSMS 执行包。 Prior to making a few changes, the task was completing in a couple minutes.在进行一些更改之前,任务已在几分钟内完成。

The only changes I made were:我所做的唯一更改是:

  1. Changing the OLE DB inputs (two in this task) from directly connecting to the source tables, to connecting to views of the table.将 OLE DB 输入(本任务中的两个)从直接连接到源表更改为连接到表的视图。 These views are very simple - just joining to another tiny table to append a particular column.这些视图非常简单 - 只需加入另一个小表即可附加特定列。 Input one has about 3 million rows, input 2 has a few hundred thousand.输入一有大约 300 万行,输入 2 有几十万行。

  2. Modified the existing lookup transform (I thought for the better) to change the connection to "SELECT col1, col2 FROM " instead of directly connecting to this table, which is very wide.修改了现有的lookup transform(我认为更好),将连接改为“SELECT col1, col2 FROM”,而不是直接连接到这个表,非常宽。

Prior to these changes, this task was completing in a few minutes.在进行这些更改之前,此任务已在几分钟内完成。 Now, while the data flow portion completes in 1-2 minutes, each validation phase (and there are two) are taking 17-20 minutes.现在,虽然数据流部分在 1-2 分钟内完成,但每个验证阶段(有两个)需要 17-20 分钟。

Is there something about having views as inputs that complicates the validation phase?将视图作为输入是否会使验证阶段复杂化?

调试屏幕截图

General approach - undo/redo step by step and see the difference.一般方法 - 逐步撤消/重做并查看差异。 Thus you cal locate problem transformation.因此,您可以调用定位问题转换。
From experience - second change is a performance boost, both for validation and runtime.根据经验 - 第二次更改是性能提升,无论是验证还是运行时。 SELECT * FROM (which is executed when you select a table from the list in Lookup) runs and validates no faster that SELECT Col1, Col2 FROM . SELECT * FROM (当您从 Lookup 中的列表中选择一个表时执行)运行和验证的速度并不比SELECT Col1, Col2 FROM快。 Besides, by doing so you reduced RAM footprint.此外,通过这样做,您减少了 RAM 占用空间。
Switch from table to view with joins can be a root of the problem.使用连接从表切换到视图可能是问题的根源。 View might have execution plan with resource-consuming operations like Nested loop etc. So, I would check view exec plan and played with undoing this switch first in SSIS package.视图可能有执行计划和资源消耗操作,如嵌套循环等。所以,我会检查视图执行计划,并首先在 SSIS 包中撤消此开关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM