Modify Optimize for...
 
Notifications
Clear all

Modify Optimize for Ad-hoc workload SQL Server Configuration

Raju
 Raju
(@raju)
Member Admin

Modify Optimize for Ad-hoc workload SQL Server Configuration

 

SELECT objtype, cacheobjtype,
    AVG(usecounts) AS Avg_UseCount,
    SUM(refcounts) AS AllRefObjects,
    SUM(CAST(size_in_bytes AS bigint))/1024/1024 AS SizeInMB
FROM sys.dm_exec_cached_plans
WHERE objtype = 'Adhoc' AND usecounts = 1
GROUP BY objtype, cacheobjtype;


SP_CONFIGURE 'Show Advanced Options', 1
GO
RECONFIGURE
GO
SP_CONFIGURE 'optimize for ad hoc workloads', 1
GO
RECONFIGURE
GO

select * from sys.configurations
where name like '%optimize for ad hoc workloads%'
Quote
Topic starter Posted : 04/12/2022 4:07 am
Share: