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 返回结果集?
基础教程推荐
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
