Updated on 2024-04-30 GMT+08:00

PGXC_STAT_WAL

PGXC_STAT_WAL displays the WAL logs and data page traffic information of the current query. This view is supported only by clusters 8.2.0 and later versions.

Table 1 PGXC_STAT_WAL columns

Name

Type

Description

query_id

bigint

ID of the current query

query_start

timestamp

Start time of the query

global_wal

bigint

Total number of WAL logs generated by the current query in the cluster, in bytes

global_avg_wal_speed

bigint

Average rate of WAL log generation for the current query in the cluster, in byte/s

global_datapage

bigint

Total size of data pages generated by the current query in the cluster, in bytes

global_avg_datapage_speed

bigint

Average rate of data page generation for the current query in the cluster, in byte/s

min_wal_node

Text

Name of the instance group that generates the smallest volume of WAL logs in the current query

min_wal

bigint

Minimum WAL logs generated by a node, in bytes

max_wal_node

Text

Name of the instance group that generates the largest volume of WAL logs in the current query

max_wal

bigint

Maximum WAL logs generated by a node, in bytes

min_datapage_node

Text

Name of the instance group that generates the smallest volume of data pages in the current query

min_data_page

bigint

Minimum data pages generated by a node, in bytes

max_datapage_node

Text

Name of the instance group that generates the largest volume of data pages in the current query

max_data_page

bigint

Maximum data pages generated by a node, in bytes

avg_wal_per_node

bigint

Average WAL logs generated by each node, in bytes

avg_datapage_per_node

bigint

Average data pages generated by each node, in bytes

query

Text

Statement that is being executed

When row-store data is imported in batches without indexes, the Xlogs related to logical new pages are generated during data page copy. If the volume of Xlogs is greater than the default value, flow control will be triggered.

Examples

Query the statements that are being executed in the cluster, the total volumes of WAL logs and data pages generated by these statements, their average generation rates, and their distribution on DNs.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SELECT * FROM PGXC_STAT_WAL;
     query_id      |          query_start          | global_wal | global_avg_wal_speed | global_datapage | global_avg_datapage_speed | min_wal_node | min_wal  | max_wal_node | max_wal  | min_datapage_node | min_data_page | max_datapage_node | max_data_page | avg_wal_per_node |
avg_datapage_per_node |                    query
-------------------+-------------------------------+------------+----------------------+-----------------+---------------------------+--------------+----------+--------------+----------+-------------------+---------------+-------------------+---------------+------------------+-
----------------------+----------------------------------------------
 72620543991351767 | 2022-11-10 16:49:47.743291+08 |    7579052 |               419000 |       284057600 |                  15740000 | datanode1    |  7579052 | datanode1    |  7579052 | datanode1         |     284057600 | datanode1         |     284057600 |          7579052 |
            284057600 | insert into mpptest3 select * from mpptest3;
 72620543991351781 | 2022-11-10 16:50:00.616697+08 |   55022176 |             10638000 |               0 |                         0 | datanode1    | 55022176 | datanode1    | 55022176 | datanode1         |             0 | datanode1         |             0 |         55022176 |
                    0 | insert into mpptest1 select * from mpptest1;
(2 rows)