开发者

Indexed properties with Linq?

开发者 https://www.devze.com 2023-02-10 00:39 出处:网络
In a database we create indexes on columns that we want to query with joins. Does Linq to objects facilitate this in any way?

In a database we create indexes on columns that we want to query with joins.

Does Linq to objects facilitate this in any way?

I imagine that search performance could be (much) improved when somehow List's can be supported by binary trees (indexes) in memory that are mapped to spec开发者_运维问答ific properties of T.

I am thinking of Lists that do not have to be optimized for inserts or deletes.

One could turn off the index for another optimization.


No; LINQ does not use indexes.

Instead, you can use i4o, which does.

Note that many LINQ operations, such as Distinct, Join, GroupBy, and others, will build a hasttable (or hashset, as appropriate) to avoid O(n2) performance.
For more information, see Jon Skeet's EduLINQ series.

0

精彩评论

暂无评论...
验证码 换一张
取 消