实体数据模型更快?

编程入门 行业动态 更新时间:2024-10-26 18:23:04
本文介绍了实体数据模型更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在搜索表时,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

更多推荐

实体数据模型更快?

本文发布于:2023-11-04 05:49:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557116.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:更快   实体   数据模型

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!