A workshop customer suspected one of their queries used too much memory. Here is the script I gave them to list running queries with Memory Grant and plan.
Optimize for Ad Hoc Workloads: When to Turn It On
Optimize for Ad Hoc Workloads shrinks the memory that one-time queries take in the plan cache. This post builds a demo of single-use plans, measures their share of the cache, and shows how to read the result. It also covers the cost of the setting and why parameterized queries are the better fix.
SQL SERVER – How to Enable Lock Pages in Memory?
Recently I received an email from user that he tried to search for solution on SQLAuthority.com for how to enable lock pages in memory but could not find a solution for it.
How to Find SQL Server Memory Use by Database and Objects? – Interview Question of the Week #121
Which database uses the most buffer pool? Queries on sys.dm_os_buffer_descriptors to find SQL Server Memory use by database and by object.
SQL SERVER – Using dm_db_stats_properties With InMemory OLTP Tables
Does sys.dm_db_stats_properties show modified rows for InMemory OLTP tables? I tested it, and memory-optimized tables are now covered. Here is what I found.





