哪个更快:在内存中过滤数据集或从SQL Server返回结果集? [英] Which is faster: filtering a DataSet in-memory or returning a result set from SQL Server?

查看:90
本文介绍了哪个更快:在内存中过滤数据集或从SQL Server返回结果集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一张非常大的桌子(记录和攀登80万张),我想过滤所述桌子。问题是,表存储在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由于内存不足而无法分页,因此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...

这篇关于哪个更快:在内存中过滤数据集或从SQL Server返回结果集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆