实体数据模型更快? [英] Entity Data Model is faster?

查看:83
本文介绍了实体数据模型更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在搜索表时,ADO.NET实体数据模型框架是否利用索引列吗?

假设您有一个带有索引列"Age"的表"Person"

如果表"Person"中没有索引列,下面的代码是否比其自身的速度更快?

Does ADO.NET Entity Data Model Framework take advantage of indexed columns at the time of search over a table?

Suppose you have a table "Person" with an indexed column "Age"

Is the code below faster than itself if no indexed columns exists in table "Person"?

var query = from p in context.People
            where p.Age == 20
            select p;   

推荐答案

Hello Arpoarpo,

您提供的代码的where子句部分已集成到SQL中,该SQL由实体框架"发送到DBMS.因此,是的,如果在年龄"列上有索引,则返回数据的速度应该比
当该列未建立索引时.是否可以测量取决于表中的数据量.

我希望能回答您的问题.如果您有任何疑问,请与我联系.

干杯

曼弗雷德(Manfred)
Hello Arpoarpo,

The where clause part of the code you gave is integrated into the SQL that gets sent to the DBMS by the "Entity Framwork". So yes, if there is an index on column "Age" it should be faster in returning data than
when the column is not indexed. If this is measureable depends on the amount of data in your table.

I hope that answers your question. If you have any doubt check back with me.

Cheers

Manfred


这篇关于实体数据模型更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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