Please add an asnocache() in linq
EFCore will cache expression,but I use System.Linq.Dynamic.Core to build the dynamic where expression, I don't want to cache then, can you give an options to disable cache when I don‘t want to,like asnotracking() ?
@vincywindy note that we already have already capped the query cache size for 3.0.0 (#17600), so caching shouldn't have any sort of adverse effects, even if each query is executed only once.
Also, just to make sure that you realize that generating completely dynamic queries impacts perf in a very negative way - EF Core's compilation is a heavy process, and most databases also have server-side query caches which will get adversely by this. You can generate dynamic where expressions, but as long they have the same structure and are properly parameterized caching will occur and improve performance significantly.
@vincywindy注意,我们已经将查询缓存的大小限制为3.0.0(#17600),因此即使每个查询仅执行一次,缓存也不会产生任何不利影响。
另外,只是为了确保您意识到生成完全动态的查询会以非常负面的方式影响性能-EF Core的编译过程很繁琐,并且大多数数据库还具有服务器端查询缓存,这将对此产生不利影响。您可以生成动态的where表达式,但是只要它们具有相同的结构并进行适当的参数化缓存,就会显着提高性能。
Does cache has timeout?I mean life time?
Cached queries start getting evicted once the cache limit has been reached. Again, as there's an upper bound on the total memory used, this isn't supposed to be a concern to users.
Thanks