Posts

Showing posts from June, 2021

Index Related Dynamic Management Views and Functions (Transact-SQL)

Name:   sys.dm_db_column_store_row_group_physical_stats (Transact-SQL) Applies to: SQL Server 2016 (13.x) and later, Azure SQL Database, Azure SQL Managed Instance Description: Provides current rowgroup-level information about all of the columnstore indexes in the current database. Permission: Requires CONTROL permission on the table and VIEW DATABASE STATE permission on the database. Examples: Calculate fragmentation to decide when to reorganize or rebuild a columnstore index. For columnstore indexes, the percent of deleted rows is a good measure for the fragmentation in a rowgroup. When the fragmentation is 20% or more, remove the deleted rows. This example joins sys.dm_db_column_store_row_group_physical_stats with other system tables and then calculates the Fragmentation column as an estimate of the efficiency of each row group in the current database. To find information on a single table, remove the comment hyphens in front of the WHERE clause and provide a table name. SELEC...

IMP DMVs, SPs & Functions that Every DBA should know

Dynamic management views and functions return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance. There are two types of dynamic management views and functions: 1)   Server-scoped dynamic management views and functions. These require VIEW SERVER STATE permission on the server. 2)  Database-scoped dynamic management views and functions. These require VIEW DATABASE STATE permission on the database. To query a dynamic management view or function requires SELECT permission on object and VIEW SERVER STATE or VIEW DATABASE STATE permission. If a user has been granted VIEW SERVER STATE permissions but denied VIEW DATABASE STATE permission, the user can see server-level information, but not database-level information. All dynamic management views and functions exist in the sys schema and follow this naming convention dm_*. When you use a dynamic management view or function, you must prefix the name of the ...