数据仓库服务 GAUSSDB(DWS)-扫描残留文件函数:pg_get_scan_residualfiles()

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

pg_get_scan_residualfiles()

描述:用于获取当前节点所有扫描到的残留文件记录。该函数为实例级函数,与当前所在的数据库无关,可以在任意实例上运行。

返回类型:record

返回信息如下:

表3 返回字段

名称

类型

描述

handled

bool

是否已处理。

dbname

text

数据库名称。

residualfile

text

残留文件路径。

size

bigint

文件大小,单位为byte。

inode

bigint

残留文件stat信息中的Inode。

atime

timestamptz

残留文件stat信息中的Access time。

mtime

timestamptz

残留文件stat信息中的Modifie time。

ctime

timestamptz

残留文件stat信息中的Chang time。

filepath

text

对应pgscrf_meta文件。

notes

text

注释。

示例:

1
2
3
4
5
6
7
8
SELECT * FROM pg_get_scan_residualfiles();
 handled |  dbname  |                            residualfile                             | size  |   inode    |         atime          |         mtime          |         ctime          |                     filepath                      | notes 
---------+----------+---------------------------------------------------------------------+-------+------------+------------------------+------------------------+------------------------+---------------------------------------------------+-------
 f       | postgres | base/16323/2147494191                                               | 81920 |  805444689 | 2023-10-27 14:21:49+08 | 2023-10-27 14:23:08+08 | 2023-10-27 14:23:08+08 | pgscrf_meta_1663_16323_20231027144103839354       | 
 f       | postgres | base/16323/2147494191_fsm                                           |     0 |  805444690 | 2023-10-27 14:21:49+08 | 2023-10-27 14:21:49+08 | 2023-10-27 14:21:49+08 | pgscrf_meta_1663_16323_20231027144103839354       | 
 f       | postgres | base/16323/2147494191_vm                                            |     0 |  805444691 | 2023-10-27 14:21:49+08 | 2023-10-27 14:21:49+08 | 2023-10-27 14:21:49+08 | pgscrf_meta_1663_16323_20231027144103839354       | 
 f       | postgres | pg_tblspc/2147484281/PG_9.2_201611171_dn_6001_6002/16323/2147894282 |     0 | 7247789391 | 2023-10-27 14:37:03+08 | 2023-10-27 14:37:03+08 | 2023-10-27 14:37:03+08 | pgscrf_meta_2147484281_16323_20231027144103839826 | 
(4 rows)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0373.html