数据仓库服务 GAUSSDB(DWS)-冷热数据管理优秀实践:查看冷热表数据分布

时间:2024-07-01 10:52:46

查看冷热表数据分布

  • 查看单表数据分布情况。
    1
    2
    3
    4
    5
    6
    7
    SELECT * FROM pg_catalog.pg_lifecycle_table_data_distribute('lifecycle_table');
    schemaname |    tablename    |   nodename   | hotpartition | coldpartition | switchablepartition | hotdatasize | colddatasize | switchabledatasize
    ------------+-----------------+--------------+--------------+---------------+---------------------+-------------+--------------+--------------------
     public     | lifecycle_table | dn_6001_6002 | p1,p2,p3,p8  |               |                     | 96 KB       | 0 bytes      | 0 bytes
     public     | lifecycle_table | dn_6003_6004 | p1,p2,p3,p8  |               |                     | 96 KB       | 0 bytes      | 0 bytes
     public     | lifecycle_table | dn_6005_6006 | p1,p2,p3,p8  |               |                     | 96 KB       | 0 bytes      | 0 bytes
    (3 rows)
    
  • 查看所有冷热表数据分布情况。
    1
    2
    3
    4
    5
    6
    7
    SELECT * FROM pg_catalog.pg_lifecycle_node_data_distribute();
    schemaname |    tablename    |   nodename   | hotpartition | coldpartition | switchablepartition | hotdatasize | colddatasize | switchabledatasize
    ------------+-----------------+--------------+--------------+---------------+---------------------+-------------+--------------+--------------------
     public     | lifecycle_table | dn_6001_6002 | p1,p2,p3,p8  |               |                     |       98304 |            0 |                  0
     public     | lifecycle_table | dn_6003_6004 | p1,p2,p3,p8  |               |                     |       98304 |            0 |                  0
     public     | lifecycle_table | dn_6005_6006 | p1,p2,p3,p8  |               |                     |       98304 |            0 |                  0
    (3 rows)
    
support.huaweicloud.com/qs-dws/dws_01_0104.html