SSIS 中查询内的Where子句与条件拆分内的Where子句之间的复杂性差异

发布于 2024-12-06 19:21:06 字数 306 浏览 2 评论 0原文

我一直想知道,这两种情况之间的复杂性差异是什么:

情况 1:一个 OLE DB 源查询,写成这样:

 select *
 from A
 where A.value > 1

情况 2:一个 OLE DB 源查询,并将 where 子句放在条件拆分

 select * from A

中在 OLE DB Source 查询之后,包含: value > 1.

性能上有什么区别吗?对于更复杂的查询,它是否也有任何重大影响?

I've been wondering, what's the complexity difference between these two cases:

Case 1: An OLE DB Source query, written like this:

 select *
 from A
 where A.value > 1

Case 2: An OLE DB Source query, and the where clause is put in Conditional Split

 select * from A

with the Conditional Split after the OLE DB Source query, containing: value > 1.

Performance-wise, does it have any difference? And for more complex query, does it have any significant impact also?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青朷 2024-12-13 19:21:06

是的,存在性能差异。

情况 2 将返回表 A 中的所有数据记录并将它们存储在 SSIS 内存缓冲区中,然后将它们传递到条件拆分组件进行过滤。

情况 1 立即将较小的数据集返回到 SSIS 内存缓冲区。

如需进一步阅读,请参阅:

Yes there is a performance difference.

Case 2 will return all data records from table A and store them in the SSIS memory buffer before passing them on to the Conditional Split Component for filtering.

Case 1 immediately returns a smaller data set to the SSIS memory buffer.

For further reading take a look at:

偏爱你一生 2024-12-13 19:21:06

SSIS 的主要用途是与异构源(例如文本文件、Excel 电子表格等)导入/导出。您可以在将数据加载到服务器之前进行某种验证,并且可能会在某处记录“错误”记录。
但是,如果您计划仅将 SSIS 与 SQL 查询结合使用,并且在文本文件中不进行任何验证或错误日志记录,那么您应该寻找其他解决方案(链接服务器、OPENROWSET 等)。

但如果您仍在查看 SSIS,则应该在 SQL 查询或数据源中包含所有可能的逻辑。

有一篇关于如何使用 SSIS 准备快速提取的文章: http: //www.sqllion.com/2009/04/faster-extraction-loading-by-ssis/

Try to avoid type casting or manipulating data types inside the SSIS package as it is an additional overhead for SSIS. Do it prior to the package or do typecasting in the source query of OLE DB Source component.

Main purpose of SSIS is Import/Export with/from heterogeneous source (such as text files, Excel spreadsheets etc). You can make some kind of validation before you loading data to server and it is possible to log "wrong" records somewhere.
But if you plan to use SSIS with SQL query only and without any validation or error logging in text files, you should look for another solution (Linked server,OPENROWSET and some more).

But if you are still look at SSIS, you should include all possible logic inside SQL query or data source.

There is article about how to prepare fast extraction using SSIS: http://www.sqllion.com/2009/04/faster-extraction-loading-by-ssis/

Try to avoid type casting or manipulating data types inside the SSIS package as it is an additional overhead for SSIS. Do it prior to the package or do typecasting in the source query of OLE DB Source component.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文