码迷,mamicode.com
首页 > 其他好文 > 详细

统计Partition占用的Pages

时间:2016-07-10 13:53:17      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

sys.dm_db_partition_stats Returns page and row-count information for every partition in the current database.

in_row_data_page_count:Number of pages in use for storing in-row data in this partition. If the partition is part of a heap, the value is the number of data pages in the heap. If the partition is part of an index, the value is the number of pages in the leaf level. (Nonleaf pages in the B-tree are not included in the count.) IAM (Index Allocation Map) pages are not included in either case. Always 0 for an xVelocity memory optimized columnstore index.

in_row_used_page_count:Total number of pages in use to store and manage the in-row data in this partition. This count includes nonleaf B-tree pages, IAM pages, and all pages included in the in_row_data_page_count column. Always 0 for a columnstore index.

in_row_reserved_page_count:Total number of pages reserved for storing and managing in-row data in this partition, regardless of whether the pages are in use or not. Always 0 for a columnstore index.

 

select ps.partition_id,
    ps.object_id,
    ps.index_id,
    ps.partition_number,
    ps.in_row_data_page_count,
    ps.in_row_used_page_count,
    ps.in_row_reserved_page_count,

    ps.lob_used_page_count,
    ps.lob_reserved_page_count,

    ps.row_overflow_used_page_count,
    ps.row_overflow_reserved_page_count,

    ps.used_page_count,
    ps.reserved_page_count,
    ps.row_count
    
from sys.dm_db_partition_stats ps
inner join sys.objects o 
    on ps.object_id=o.object_id
where o.name=NUsers

 

参考文档:

sys.dm_db_partition_stats (Transact-SQL)

统计Partition占用的Pages

标签:

原文地址:http://www.cnblogs.com/ljhdo/p/5657516.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!