Just found that for a query running in sql server 2012 .. the cache plan size in actual execution plan gives the size as 16KB where as the plan cache the value is 24KB(24576 bytes).. any idea y is it so?
Asked
Active
Viewed 352 times
1 Answers
0
An estimated execution plan doesn't know all the details at the time, they just look at the "rough" size of the tables and use them to estimate caching plans and exec plans.
If you take the example of searching for an entry in a table, the table may be accessed differently than "estimated" so the cache of indexes may have been created in a different order.
Remember the execution plan is best guess only, where as the actual plan is more realistic, and the actual plan will change from time to time depending on access statistics of the db.

John Mitchell
- 9,653
- 9
- 57
- 91
-
I am referring to the difference in the cached plan size in "Plan Cache - sys.dm_exec_cached_plans.size_in_bytes" and the cached plan size displayed in actual execution plan not the difference in estimated and actual execution plans. – Ahmad Osama Jun 16 '12 at 13:01