简体   繁体   English

如何在分区级别查看分区表的I / O统计信息

[英]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.). 我已经按日期列将表划分为10个分区,并希望了解如何使用每个分区(I / O统计信息等)。 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? 有没有一种方法可以确定分区级别的I / O统计信息?

Few approaches: 几种方法:

  1. It is possible via: sys.dm_io_virtual_file_stats 可以通过以下方式进行: 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 另一种方法是sys.dm_db_index_operational_stats

This DMV can provide data structure usage stats per object/index/partition: 该DMV可以提供每个对象/索引/分区的数据结构使用情况统计信息:

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 }    
)    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL - 在根据另一个表中的值检查分区字段时,我可以使用分区吗? - SQL - Can I make use of a partition when checking the partitioned field against value from another table? 如何在 ORACLE 中交换分区。 ORA-14095: ALTER TABLE EXCHANGE 需要非分区、非聚集表 - How I can to exchange partition in ORACLE. ORA-14095: ALTER TABLE EXCHANGE requires a non-partitioned, non-clustered table 如何在Hive上对未分区的表进行分区? - How to partition a non-partitioned table on Hive? Hive:如何将数据从分区表插入分区表? - Hive: How do I INSERT data FROM a PARTITIONED table INTO a PARTITIONED table? 我可以用函数 mr 返回一个非分区表吗? - Can I return a non-partitioned table with function mr? 当表按天分区时,BigQuery 如何按月/年查询分区? - BigQuery how to query partition by month/year when table partitioned by day? 如何在BigQuery中将查询保存为分区表? - How do I save a query as partitioned table in BigQuery? 如何按所有值对表进行分区? - How do I partition a table by all values? 如何查询SQL中按字段划分的单个记录? - How can I query the a single record partitioned by a field in SQL? 如何编写分区SQL表查询? - How can I write a query for Partitioned SQL tables?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM