tencentdb_wal_stat
tencentdb_wal_stat · TencentDB proprietary WAL diagnostics extension that scans recent WAL files and attributes record counts, bytes, resource-manager types, and full-page images by database, schema, and relation.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101185 | tencentdb_wal_stat | tencentdb_wal_stat | 1.0 | STAT | Unknown | C |
PostgreSQL · 14, 15, 16, 17, 18
Usage
Sources:
tencentdb_wal_stat is a TencentDB for PostgreSQL diagnostic extension that reads recent WAL files and attributes record counts, data bytes, full-page images, resource-manager types, and relation identifiers. Use it to identify databases, schemas, tables, or indexes associated with a WAL surge; it is not a long-term WAL history store.
Requirements and Core Workflow
Tencent documents version 1.0 for TencentDB PostgreSQL 15 or later, executed on the primary by a member of pg_tencentdb_superuser:
Pass the number of recent WAL files to inspect, from 1 through 500. This query finds the largest table/index contributors in the last 50 available files:
Aggregate wal_bytes + wal_fpi_bytes for total attributed size. Group by database_name, schema_name, or rmgr_name to move from instance-level triage to a database, schema, or write type.
Output and Interpretation
database_oid,schema_oid, andrelation_oididentify objects; companion name columns are resolved where catalogs are available.relation_kinddistinguishes tables, indexes, TOAST, sequences, materialized views, shared/system objects, and unknown objects.rmgr_nameclassifies WAL by resource manager, such asHeap,Btree, orTransaction.wal_recordsandwal_bytescount records and non-FPI bytes;wal_fpiandwal_fpi_bytescount full-page images and their bytes.
Operational Boundaries
- The function is available only on the primary and requires the provider role. It is a TencentDB component; do not expect the package or role on community PostgreSQL.
- Larger
wal_numvalues read more WAL and take longer. Tencent recommends using large ranges off peak; start small for incident triage and monitor the query itself. - Only WAL files that have not been recycled can be analyzed. The argument is a file count, not a time interval, so traffic volume and WAL segment size affect the covered period.
- Names for objects in other databases may appear as
<oid:N>or<filenode:N>because their catalogs cannot be resolved from the current database. Preserve OIDs and join names from the correct database rather than treating placeholders as missing WAL. - Attribution is diagnostic evidence, not a causal proof. Correlate it with workload, checkpoints, replication slots/lag, archiving, disk use, and query statistics before changing indexes, throttling tenants, or tuning
max_wal_size.