Skip to content

QueryCache misses for dynamically created queries with ConstantExpresssions or nested MemberExpressions from closure #8909

@Tasteful

Description

@Tasteful

I got a lot of dupplicated entries in the MemoryCache that origin from EF and many of them contains the same sql query and is generated from the exact same code.

Example the following that generate an SQL query that is duplicated in cache more than 16 000 times.

image

When I checking the entity in the MemoryCache we can se a lot of repeated entries that is 14 338 bytes each but contains the same query.

image

The only "special" that I can remember that I have done is that the query is built with System.Linq.Expressions.Expression that is added to the query with .Where(expression).

What is the best approach to find the reason for this cache misses?

Further technical details

EF Core version: 1.1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions