For Entity SQL queries, query plan caching stores information that is computed as part of putting together the query itself. By caching this information, a subsequent execution of the same query (even if you change parameter values) will run much faster than the first one. This information is cached per app domain, so you will generally benefit from the query cache across multiple client requests to the same web app and the like. For LINQ queries, you need to use "compiled queries" to achieve this same effect. See the question below about compiled queries for more information on how to do that. You do not have to keep an ObjectQuery instance around to take advantage of the query plan cache. Future ObjectQuery instances that use the same query string will automatically take advantage of it. For more information, see Performance Considerations for Entity Framework Applications. From http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2363212&SiteID=1.
Take a look at some relevant posts on the ADO.NET team blog starting with this one: EF Performance Comparison. For more information, see Performance Considerations for Entity Framework Applications.
Yes. Entity models are not like class models, and inheritance has a performance and complexity cost that it does not have in pure code-based systems. The number of relationships also has an impact on performance.
The following articles discuss how to work with compiled queries:
Unfortunately, there aren't very good workarounds at the moment. The best suggestion is to break the model into multiple smaller models. Generally the suggested target is 200 tables or fewer for each model. This is an area the EF team hopes to improve in future releases. The following articles discuss how to work with large models:
See the following articles:
The EF doesn't have data caching built in. The EF does identity resolution, which is sometimes thought of as a first-level data cache, but it's not really a cache in the strict sense of the term. The EF does cache metadata and (as described above query plan information). There are a couple of samples that show how to do some kinds of data caching:
Richard Mueller edited Revision 12. Comment: Replace RGB values with color names in HTML to restore colors
nice