数据仓库服务 GAUSSDB(DWS)-统计信息函数:pgxc_stat_wal_write()

时间:2024-01-26 16:15:21

pgxc_stat_wal_write()

描述:在所有CN上执行,记录各个DN上与CN交互的线程信息,并统计wal日志和数据页导入量及速率。该函数仅8.2.0及以上集群版本支持。

返回值类型:bigint

返回值字段:
  • node_name:实例名。
  • application_name:应用名。
  • query_start:当前正在执行语句的起始时间。
  • datapage_write:当前query导入的数据页总量,单位为bytes。
  • datapage_write_speed:数据页导入速率,单位为bytes/s。
  • wal_write:当前query导入的wal日志总量,单位为bytes。
  • wal_write_speed:wal导入速率,单位为bytes/s。
  • total_datapage_write:当前线程产生数据页总量,单位为bytes。
  • total_wal_write:wal总量,单位为bytes。
1
2
3
4
5
6
7
8
9
SELECT * FROM pgxc_stat_wal_write();
 node_name | datid |       pid       | lwtid | usesysid |    application_name    | state  |          query_start          |         backend_start         |     query_id      | datapage_write | datapage_write_speed | wal_write | wal_write_speed | total_datapage_write | total_wal_write
-----------+-------+-----------------+-------+----------+------------------------+--------+-------------------------------+-------------------------------+-------------------+----------------+----------------------+-----------+-----------------+----------------------+-----------------
 datanode1 | 15979 | 140328473442048 | 12408 |       10 | CalculateSpaceInfo     | active | 2022-11-15 10:39:45.00219+08  | 2022-11-15 10:39:45.000918+08 |                 0 |              0 |                    0 |     70697 |               0 |                    0 |               0
 datanode1 |     0 | 140328075503360 | 12510 |       10 | WalSender to Secondary | idle   |                               | 2022-11-15 10:39:46.708557+08 |                 0 |              0 |                      |       210 |               0 |                    0 |               0
 datanode1 | 15979 | 140327896741632 | 13612 |       10 | coordinator1           | active | 2022-11-15 10:46:32.832548+08 | 2022-11-15 10:40:20.117516+08 | 72620543991349940 |      586579968 |             17425000 |  11743056 |          348000 |           5337505792 |       107245825
 datanode1 | 15979 | 140327583217408 | 13614 |       10 | coordinator1           | active | 2022-11-15 10:46:32.832548+08 |                               | 72620543991349940 |              0 |                    0 |         0 |               0 |                    0 |               0
 datanode1 | 15979 | 140327485175552 | 27914 |       10 | coordinator1           | active | 2022-11-15 10:47:06.493584+08 | 2022-11-15 10:47:06.489062+08 | 72620543991350020 |              0 |                    0 |         0 |               0 |                    0 |            8675
(5 rows)

行存不带索引批量导入时,数据页copy导入会产生logical newpage相关的xlog日志,在xlog量大于默认值时同样会触发流控。

support.huaweicloud.com/sqlreference-820-dws/dws_06_0065.html