Hello All:
Can any body help me in understanding if the execution plan for functions cached in SQL server?
Any online resource for this?
Thanks Ashwani
Hello All:
Can any body help me in understanding if the execution plan for functions cached in SQL server?
Any online resource for this?
Thanks Ashwani
Yes they do go in the execution plan cache.
The sys.dm_exec_query_plan DMV will show a plan for given plan handle. Quote from there:
Query plans for various types of Transact-SQL batches, such as ad hoc batches, stored procedures, and user-defined functions, are cached in an area of memory called the plan cache. Each cached query plan is identified by a unique identifier called a plan handle. You can specify this plan handle with the sys.dm_exec_query_plan dynamic management view to retrieve the execution plan for a particular Transact-SQL query or batch.