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 返回结果集?
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- WPF 模态进度窗口 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
