数据仓库服务 GAUSSDB(DWS)-其它函数:get_col_cu_info(schema_name text, table_name text, row_count int8, dirty_percent int8)

时间:2024-11-28 17:38:53

get_col_cu_info(schema_name text, table_name text, row_count int8, dirty_percent int8)

描述:查询某张列存表的CU信息,每个分区单独统计。该函数仅8.2.0.100及以上集群版本支持。

参数:模式名(必选),表名(必选),小CU的行数阈值(可选,默认200,取值范围为1~60000),脏CU的删除百分比阈值(可选,默认70,取值范围1~100)。

返回值类型:record

返回值字段:

node_name:DN节点名。

part_name:分区名,普通表此列为空。

zero_size_cu_count:cuSize=0,且行数小于等于row_count的CU数。

small_cu_count:cuSize=ALIGNOF_CUSIZE(8192),且行数小于等于row_count的CU数。

dirty_cu_count: 因delete,deadtupe占比超过dirty_percent的CU数。

total_cu_count:总CU数。

small_cu_size:8k CU的总大小。

total_cu_size:总CU大小。

示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 SELECT * FROM get_col_cu_info('public','hs_part');
 node_name | part_name | zero_size_cu_count | small_cu_count | dirty_cu_count | total_cu_count | small_cu_size | total_cu_size
-----------+-----------+--------------------+----------------+----------------+----------------+---------------+---------------
 dn_1      | p1        |                  3 |              0 |              0 |              3 | 0 bytes       | 0 bytes
 dn_1      | p2        |                  3 |              0 |              0 |              3 | 0 bytes       | 0 bytes
 dn_1      | p3        |                  3 |              0 |              0 |              3 | 0 bytes       | 0 bytes
(3 rows)

 SELECT * FROM get_col_cu_info('public','hs_part', 200, 90);
 node_name | part_name | zero_size_cu_count | small_cu_count | dirty_cu_count | total_cu_count | small_cu_size | total_cu_size
-----------+-----------+--------------------+----------------+----------------+----------------+---------------+---------------
 dn_1      | p1        |                  3 |              0 |              0 |              3 | 0 bytes       | 0 bytes
 dn_1      | p2        |                  3 |              0 |              0 |              3 | 0 bytes       | 0 bytes
 dn_1      | p3        |                  3 |              0 |              0 |              3 | 0 bytes       | 0 bytes
(3 rows)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0062.html