How fast is LINQ?

前端 未结 7 1664
天涯浪人
天涯浪人 2021-01-04 23:36

I need to manipulate 100,000 - 200,000 records.
I am thinking of using LINQ (to SQL) to do this.
I know from experience that filtering dataviews is very slow.
So

7条回答
  •  孤城傲影
    2021-01-05 00:09

    It's worth bearing in mind that LINQ to SQL works by retrieving the object from the database first, you then apply property changes to the objects and call SubmitChanges to persist them back whereupon each row/object emits the necessary update statement.

    For bulk updates this is nowhere near as efficient as just sending a single update statement that applies to an entire batch of rows at a time.

提交回复
热议问题