The topic describes the DF051 T-SQL code analysis rule.
PERFORMANCE
The DBCC FREEPROCCACHE/DROPCLEANBUFFERS command is used.
It is not recommended to use DBCC FREEPROCCACHE/DROPCLEANBUFFERS because of the possibility of performance degradation.
These commands are used for testing and troubleshooting issues. However, if you use them too much, they can lead to decreased performance by removing cached query plans and data pages from memory, forcing SQL Server to recompile queries and reload data pages, which can increase CPU and I/O overhead.
Be cautious when using DBCC FREEPROCCACHE to clear the plan cache. Doing so removes all plans stored in the cache, causing new query executions to compile fresh plans instead of reusing cached ones. This may temporarily reduce query performance, as more new compilations are required. In addition, each cleared cachestore in the plan cache will be logged.
ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READONLY;
GO
ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READWRITE;
GO
ALTER DATABASE demodb SET TORN_PAGE_DETECTION ON;
GO
ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READ_ONLY;
GO
ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READ_WRITE;
GO
ALTER DATABASE demodb SET PAGE_VERIFY CHECKSUM;
GO