简体   繁体   中英

How can I view I/O stats of a partitioned table at the partition level

I have partitioned my table by a date column into 10 partitions and would like to see how EACH partition is getting used (I/O stats, etc.). I would hope this would give some insight into how the existing queries are using individual partitions, if at all, so that I might optimize the queries. Is there a way of determining the I/O stats AT THE PARTITION LEVEL?

Few approaches:

  1. It is possible via: sys.dm_io_virtual_file_stats

But it will work only in case if every partition resides in own filegroup

  1. Another way is sys.dm_db_index_operational_stats

This DMV can provide data structure usage stats per object/index/partition:

sys.dm_db_index_operational_stats (    
    { database_id | NULL | 0 | DEFAULT }    
  , { object_id | NULL | 0 | DEFAULT }    
  , { index_id | 0 | NULL | -1 | DEFAULT }    
  , { partition_number | NULL | 0 | DEFAULT }    
)    

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM