This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a script for checking the newly allocated pages to the table of SQL Server.
The use of this script is in very rare condition. If you are doing deep work like monitoring allocation and space management, you will need this kind of script.
For example, If you are doing bulk load, data page allocation should be in sequence for better performance. You can use this script for comparing page allocation before and after of Bulk load activity.
Below is a script:
1 2 3 4 5 6 7 8 9 10 |
SELECT OBJECT_NAME(p.object_id) AS object_name ,i.name AS index_name ,ps.in_row_used_page_count FROM sys.dm_db_partition_stats ps JOIN sys.partitions p ON ps.partition_id = p.partition_id JOIN sys.indexes i ON p.index_id = i.index_id AND p.object_id = i.object_id |
Leave a Reply