There is a world-famous “optimize for ad hoc workloads” Server Configuration Option in SQL Server since the version 2008 (meaning it is well over 10 years old), which is a great help for the to clean the single-use plan cache…
Optimize for Analytics (Should be a Database Configuration option)




