如果一个表有10亿或更多的记录,哪种方法在.net中检索更快? [英] If a table have 10 crore records or more, which approach is better in .net to retrieve faster?

查看:79
本文介绍了如果一个表有10亿或更多的记录,哪种方法在.net中检索更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个表有10亿或更多的记录,哪种方法在.net中检索得更快?使用EF(数据库优先,模态优先,代码优先)或使用存储过程。我正在使用MS SQL Server 2008数据库。

If a table have 10 crore records or more, which approach is better in .net to retrieve faster? Using EF(Database First, Modal First, Code First) or Using Stored Procedure. I'm use MS SQL Server 2008 databse.

推荐答案

不幸的是,这不是一个有意义的问题。

实体框架是一个层,它位于您的.NET(c#或VB)应用程序上,并与数据库交互。

存储过程位于SQL Server内部并在服务器上执行,就像您传递了代码一样它们包含一个Command对象。



它们不是可比较的做事方式,延迟将在数据库服务器和应用程序之间传递信息不是你必须传递给SQL多少命令。



你将遇到的最明显的延迟是生成数据用于演示,特别是如果你正在尝试向用户显示100,000,000行数据!
That isn't a question which makes any sense, unfortunately.
Entity Framework is a "layer" which sits on your .NET (c# or VB) application and which interacts with a DB.
Stored procedures sit inside SQL Server and execute on the server as if you had passed the code they contain as a single Command object.

They aren't comparable ways of doing things, the delay will be in the transfer of information between the DB server and your application not in how much of a command you have to pass to SQL.

The most appreciable delay you will meet will be in generating data for presentation, particularly if you are trying to display 100,000,000 rows of data to a user!


这篇关于如果一个表有10亿或更多的记录,哪种方法在.net中检索更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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