Skip to content

Warning for EF generated queries that weren't in the Query Plan Cache (cold queries) #481

Open
@RudeySH

Description

@RudeySH

This might be out of scope, but it would be a great addition. MiniProfiler already warns about duplicate SQL queries, so a warning about queries not coming from the query plan caches fits right in.

https://docs.microsoft.com/en-us/ef/ef6/fundamentals/performance/perf-whitepaper#32-query-plan-caching

TL;DR: The first time a query is run it takes longer because EF hasn't cached it yet. There are also various reasons why a query might never be cached. Eventually cache entries will be evicted as wel.

If MiniProfiler could indicate which queries come from the cache, and which ones don't, that would be super helpful. When profiling, it is always useful to know if the query is cold (not in the cache yet). It would also help spot us find queries that never get cached, just like we can currently use MiniProfiler to spot duplicate queries.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions