Which is faster: filtering a DataSet in-memory or returning a result set from SQL Server?(哪个更快:过滤内存中的 DataSet 或从 SQL Server 返回结果集?)
问题描述
我正在处理一张非常大的表格(800k 记录和攀爬),我想过滤所述表格.问题是,该表存储在 SQL Server 中.所以,我想知道,会不会
I'm working on a pretty large table, (800k records and climbing) and I'd like to filter said table. The thing is, the table is stored in SQL Server. So, I was wondering, would a
SELECT * FROM table WHERE condition1=true
查询比将表加载到类型化的 DataSet 并使用 DataRow.Find() 然后将所有这些发送到另一个 DataTable 更快吗?
query be faster than loading the table to a typed DataSet and using DataRow.Find() then sending all those to another DataTable?
我猜是的,但我还是会问.
I'm guessing yes, but I'll ask anyway.
推荐答案
只要你的 SQL Server 没有因为 RAM 不足而分页,SQL Server 应该总是比通过网络加载整个表然后在本地过滤要快..
As long as your SQL server is not paging because of RAM starvation the SQL Server should always be faster than loading the whole table via network and then filtering locally...
这篇关于哪个更快:过滤内存中的 DataSet 或从 SQL Server 返回结果集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:哪个更快:过滤内存中的 DataSet 或从 SQL Server 返回结果集?


基础教程推荐
- 将 XML 转换为通用列表 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- SSE 浮点算术是否可重现? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01