2 years ago

#52690

test-img

SurelyTheresABetterWay

Will Entity Framework Clear Query Plans in the Cache that it, itself, did not create?

We are looking to switch to EF for some of our new applications, and our Database Team has raised concerns about this particular, documented function of the Query Plan Cleanup operation of Entity Framework;

From; https://learn.microsoft.com/en-us/ef/ef6/fundamentals/performance/perf-whitepaper

  1. Once the cache contains a set number of entries (800), we start a timer that periodically (once-per-minute) sweeps the cache.
  2. During cache sweeps, entries are removed from the cache on a LFRU (Least frequently – recently used) basis. This algorithm takes both hit count and age into account when deciding which entries are ejected.
  3. At the end of each cache sweep, the cache again contains 800 entries.

In the instance that we have 2 'worlds'; one that uses EF, and one that uses Stored Procedures/Ad-hoc queries, will the 'Garbage Collector' of Execution Plans sweep up plans made by our previous implementation?

c#

entity-framework

sql-execution-plan

0 Answers

Your Answer

Accepted video resources