Optimizing Entity Framework
Entity Framework
is fine but some queries are sub-optimal. Can one write some SQL queries by hand or as MS SQL Server 2008 R2 views, execute this selects and then associate somehow entities with them? I examined some generated SQL and they are quite ugly...
Question 2: Is MS SQL Server 2008 R2 caching queries? I'd like to have strong cachin开发者_Python百科g, how can I tune it? (with MySQL it's so simple).
You have a lot of options available to you. You can use .ExecuteStoreCommand() in EF 4.1 to execute SQL against the database, or you can map stored procedures into EF as well. Furthermore, you can map views as entities in EF if that's necessary.
SQL Server has very sophisticated caching mechanisms for data pages as well as execution plans , and it's pretty much automatic to the developer. I would suggest posting a question with concrete example with the operations you want to optimize.
精彩评论