Looking at a couple of DMVs, and trying to see if I can programmatically figure out the cost of the cached plans in my SQL Server. I'm hoping that column represents the same concept of cost that is used by the optimizer to determine if the query should be parallelized, but I'm not sure. Is that the case?
Edit: below is the script I'm using:
SELECT text , objtype , refcounts , usecounts , size_in_bytes , disk_ios_count , context_switches_count , original_cost , current_cost FROM sys.dm_exec_cached_plans p CROSS APPLY sys.dm_exec_sql_text(plan_handle) JOIN sys.dm_os_memory_cache_entries e ON p.memory_object_address = e.memory_object_address WHERE cacheobjtype = 'Compiled Plan' AND type IN ( 'CACHESTORE_SQLCP', 'CACHESTORE_OBJCP' ) ORDER BY objtype DESC , usecounts DESC;