Figure 1 - Data pages that have been allocated in memory With the DMVs sys.dm_exec_cached_plans and sys.dm_exec_sql_text we can check execution plans that were stored in memory for queries executed, as illustrated on
Figure 2.
Figure 2 - Execution plans stored in memory So when all connections to the database AdventureWorks2012 are finished, all the memory areas will be cleaned, as the image below: [code language="sql"] --Amount of data pages in memory SELECT Count (*) TotalPages, DB_NAME (database_id) DBname FROM sys.dm_os_buffer_descriptors GROUP BY Db_name (database_id) ORDER BY 1 DESC --Amount of in-memory execution plans SELECT COUNT (*) TotalPlanos FROM SYS.dm_sys.dm_exec_cached_plans CROSS APPLY sys.dm_exec_sql_text sys.dm (plan_handle) Where [dbid] = 7 and objtype = ' Adhoc ' [/code]
Figure 3 - Memory usage after close all connections With this demonstration is extremely simple to conclude that the AutoClose property is always disabled due to performance problems that can bring to a high performance database.
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
A serverless audio transcription pipeline
A serverless audio transcription pipeline
Nov 14, 2017 12:00:00 AM
4
min read
SQL Server and Azure soft delete
SQL Server and Azure soft delete
Jun 22, 2018 12:00:00 AM
1
min read
PowerShell Invoke-WebRequest cmdlet and bypassing IE first-launch configuration Error
PowerShell Invoke-WebRequest cmdlet and bypassing IE first-launch configuration Error
Sep 24, 2021 12:00:00 AM
2
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.