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

时间:2024-04-18 16:25:03

pg_xlog_display_one_lsn(start_lsn)

描述:可以在CN或者DN上执行,根据起始LSN号完整解析当前位置的xlog。该函数仅8.3.0及以上集群版本支持。

入参:start_lsn,表示起始LSN。需要保证输入的起始LSN号是一条xlog的开始处。

返回值类型:record

返回信息如下:

名称

类型

描述

node_name

text

当前实例名

start_lsn

text

设定的起始LSN

end_lsn

text

设定的终止LSN

startlsn

text

xlog起始lsn

endlsn

text

xlog终止lsn

prelsn

text

前一条xlog起始lsn

xid

xid

xlog事务id号

datalen

int4

xlog数据长度,单位为byte。

totallen

int4

xlog长度,单位为byte。

type

text

xlog类型

desc

text

xlog内容

blkref

text

xlog关联的relfilenode

示例:

1
2
3
4
5
6
7
8
SELECT * FROM pg_xlog_display_one_lsn('0/101CA00');
node_name | startlsn  |  endlsn   |  prelsn   | xlog_tid | datalen | totallen |  xlogtype   |                                   xlogdescribe
          | blkref
-----------+-----------+-----------+-----------+----------+---------+----------+-------------+-------------------------------------------------------------------------
----------+--------
datanode1 | 0/101CA00 | 0/101CA78 | 0/101C3F8 |        5 |      80 |      114 | Transaction | commit: 2023-10-19 22:21:38.617092+08; csn:0; inval msgs: catcache 11 ca
tcache 10 |
(1 row)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0065.html