Optimize For Ad Hoc Workloads

The optimize for ad hoc workloads setting can be used to improve the efficiency of the execution plan cache, particularly for systems when there are a large number of ad hoc or single-use queries.

Suggested Action

šŸ’” Aireforge Advisor can automatically generate a script for this.

Enable Optimize for Ad Hoc Workloads.

How to Enable 'Optimize for Ad Hoc Workloads' On SQL Server

EXEC sys.sp_configure N'optimize for ad hoc workloads', N'1'
RECONFIGURE;
GO

Further Reading

Optimize for ad hoc workloads | Microsoft Docs