开发者

When to use Entity Framework Pre Generated Views

I have read a fair amount about pre-generated views in EF but not sure which scenarios you wouldn't use it. My understanding is it simply requires a little set-up in your project and that is the only hit. So you will therefore get a performance improvement on first acce开发者_开发问答ss of queries, essentially for free.

If that is the case why would you not simply use it on every EF project?

Thanks


From MSDN:

Link

Since the first execution of the query is where the performance gain is, leveraging pre-generated views in at least two cases will be of significant value: the warm up of a system and the execution of infrequently run queries. The use of less memory is also advantageous and is due to no longer having the overhead of keeping and creating the views.

Precompiled views improve the performance of queries the first time they are run. Subsequent executions gain no improvement because the query is then compiled. This means that the benefit of precompiling any given query is dependent on when and how often it is executed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜