Understanding SQL Server plan cache I've been reading about the SQL Server plan cache and optimizing for adhoc workloads, etc. I'm fairly new to the topic and have a few general questions to help paint a better picture:

Suppose I have several databases running under one instance of SQL Server:

(1) Is there a different plan cache per database? More specifically, when I examine sys.dm_exec_cached_plans am I looking at database-specific information or instance-wide information?

(2) Is 'optimize for adhoc workloads' set per database or per instance?
Both the Plan Cache and 'optimize for adhoc workloads' are per instance.