ADO.NET Entity Framework - Pre-Generate Views -

前端 未结 1 1307
别那么骄傲
别那么骄傲 2020-12-21 08:29

We are using ADO.NET Entity for our ASP.NET application.

I have read that the pre-generated views improves the performance. Referred to the blog post,

http:

相关标签:
1条回答
  • 2020-12-21 09:12

    I've been wondering the same thing and been doing some digging.

    As far as I can tell the generated class file contains an assembly level attribute, EntityViewGenerationAttribute, which defines the class type that contains the pre-compiled view. Then, and here im only making educated guesses, at compile time the class must be loaded via reflection and in some way bound to the queries the view defines. Possibly in the ESQL cache, which would makea certain amount of sense.

    Even though the view's are pre-compiled they only produce ESQL, not the actual TSQL which will be ran. However pre-compiling views does allow the execution of a query to skip the validation and ESQL generation step which should offer a slight performance gain, especially for large compilcated queries.

    0 讨论(0)
提交回复
热议问题