All Products
Search
Document Center

PolarDB:Instances

Last Updated:Mar 28, 2026

Describes the views and functions in PolarDB for PostgreSQL that you can query to obtain instance-level statistics, helping you troubleshoot performance issues.

Basic instance information

pg_stat_database

The pg_stat_database view displays statistics for each database in the cluster.

ParameterTypeDescription
datidoidThe object identifier (OID) of the database.
datnamenameThe database name.
numbackendsintegerThe number of backends currently connected to the database. This is the only column that reflects the current state; all other columns return cumulative values since the last statistics reset.
xact_commitbigintThe total number of transactions committed in the database.
xact_rollbackbigintThe total number of transactions rolled back in the database.
blks_readbigintThe total number of disk blocks physically read in the database.
blks_hitbigintThe number of disk block reads served from the buffer cache. This count reflects only hits in the PolarDB for PostgreSQL buffer; hits in the OS file system cache are not included.
tup_returnedbigintThe number of rows returned by queries in the database.
tup_fetchedbigintThe number of rows fetched by queries in the database.
tup_insertedbigintThe number of rows inserted by queries in the database.
tup_updatedbigintThe number of rows updated by queries in the database.
tup_deletedbigintThe number of rows deleted by queries in the database.
conflictsbigintThe number of queries canceled due to read-only node replay conflicts.
temp_filesbigintThe number of temporary files created by queries in the database. All temporary files are counted, regardless of why they were created or the log_temp_files setting.
temp_bytesbigintThe total amount of data written to temporary files by queries in the database. All temporary files are counted, regardless of why they were created or the log_temp_files setting.
deadlocksbigintThe number of deadlocks detected in the database.
blk_read_timedouble precisionThe time spent by backends reading data files in the database, in milliseconds.
blk_write_timedouble precisionThe time spent by backends writing data files in the database, in milliseconds.
stats_resettimestamp with time zoneThe last time the statistics were reset.

pg_stat_bgwriter

The pg_stat_bgwriter view contains a single row with cluster-wide statistics about the background writer process.

ParameterTypeDescription
checkpoints_timedbigintThe number of scheduled checkpoints performed.
checkpoints_reqbigintThe number of requested checkpoints performed.
checkpoint_write_timedouble precisionThe time spent writing files to disk during checkpoints, in milliseconds.
checkpoint_sync_timedouble precisionThe time spent synchronizing files to disk during checkpoints, in milliseconds.
buffers_checkpointbigintThe number of buffers written during checkpoints.
buffers_cleanbigintThe number of buffers written by the background writer process.
maxwritten_cleanbigintThe number of times the background writer stopped a cleaning scan because too many buffers were written at once.
buffers_backendbigintThe number of buffers written directly by backends.
buffers_backend_fsyncbigintThe number of times a backend executed an fsync call instead of the background writer. The background writer normally handles write operations, but backends may also perform writes.
buffers_allocbigintThe number of buffers allocated.
stats_resettimestamp with time zoneThe last time the statistics were reset.

Activity status

polar_stat_activity

The polar_stat_activity view displays the status of each backend process, providing cumulative totals per process.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
datidoidThe OID of the database.
datnamenameThe database name.
pidintegerThe process ID.
usesysidoidThe OID of the user.
usenamenameThe user name.
application_nametextThe name of the application connected to the database.
client_addrinetThe IP address of the connected client.
client_hostnametextThe host name of the connected client.
client_portintegerThe TCP port used for communication between the client and the database.
backend_starttimestampThe time when the process started.
xact_starttimestampThe time when the current transaction started.
query_starttimestampThe time when the current SQL statement started executing.
state_changetimestampThe time when the process state last changed.
wait_event_typetextThe category of event the backend is waiting for. Returns NULL if the backend is not waiting. Valid values: LWLock, Lock, BufferPin, Activity, Extension, Client, IPC, Timeout, IO. See the wait events table below for details.
wait_eventtextThe name of the wait event. Returns NULL if the backend is not waiting.
statetextThe current state of the process.
backend_xidxidThe transaction identifier (XID) of the backend.
backend_xminxidThe xmin value of the backend.
querytextThe SQL statement being executed.
backend_typetextThe type of the backend process.
queryidbigintThe unique ID of the SQL statement.
wait_objecttextThe wait object. Populated when the backend is waiting for an event.
wait_typetextThe type of the wait object. Populated when the backend is waiting for an event.
wait_time_msdoubleThe wait time elapsed, in milliseconds. Populated when the backend is waiting for an event.
cpu_userbigintThe user CPU usage of the backend.
cpu_sysbigintThe system CPU usage of the backend.
rssbigintThe memory usage of the backend, in bytes.
pfs_read_psbigintThe cumulative number of read operations on the Polar File System (PFS).
pfs_write_psbigintThe cumulative number of write operations on PFS.
pfs_read_throughputbigintThe cumulative read throughput of PFS, in bytes.
pfs_write_throughputbigintThe cumulative write throughput of PFS, in bytes.
pfs_read_latency_msdoubleThe read latency for PFS operations, in milliseconds.
pfs_write_latency_msdoubleThe write latency for PFS operations, in milliseconds.
local_read_psbigintThe cumulative number of read operations on the local file system.
local_write_psbigintThe cumulative number of write operations on the local file system.
local_read_throughputbigintThe cumulative read throughput of the local file system, in bytes.
local_write_throughputbigintThe cumulative write throughput of the local file system, in bytes.
local_read_latency_msdoubleThe read latency for local file system operations, in milliseconds.
local_write_latency_msdoubleThe write latency for local file system operations, in milliseconds.

Wait events

The following table describes the wait events returned in the wait_event_type and wait_event columns.

Wait event typeWait event nameDescription
LWLockShmemIndexLockWaiting to find or allocate space in shared memory.
OidGenLockWaiting to allocate or assign an OID.
XidGenLockWaiting to allocate or assign a transaction ID (XID).
ProcArrayLockWaiting to obtain a snapshot or clear an XID at the end of a transaction.
SInvalReadLockWaiting to retrieve or remove a message from the shared invalidation message queue.
SInvalWriteLockWaiting to add a message to the shared invalidation message queue.
WALBufMappingLockWaiting to replace a page in the write-ahead logging (WAL) buffer.
WALWriteLockWaiting for a WAL buffer to be written to disk.
ControlFileLockWaiting to read or update the control file, or to create a WAL file.
CheckpointLockWaiting to perform a checkpoint.
CLogControlLockWaiting to read or update transaction status.
SubtransControlLockWaiting to read or update subtransaction information.
MultiXactGenLockWaiting to read or update the shared multixact state.
MultiXactOffsetControlLockWaiting to read or update multixact offset mappings.
MultiXactMemberControlLockWaiting to read or update multixact member mappings.
RelCacheInitLockWaiting to read or write the relation cache initialization file.
CheckpointerCommLockWaiting to manage fsync() calls.
TwoPhaseStateLockWaiting to read or update the status of a prepared transaction.
TablespaceCreateLockWaiting to create or drop a tablespace.
BtreeVacuumLockWaiting to read or update vacuum-related information for a B-tree index.
AddinShmemInitLockWaiting to manage space allocation in shared memory.
AutovacuumLockWaiting to update or read the status of an autovacuum worker.
AutovacuumScheduleLockWaiting to confirm that the table selected for vacuuming still needs to be vacuumed.
SyncScanLockWaiting to get the starting scan location for synchronized scans on a table.
RelationMappingLockWaiting to update the relation mapping file used for catalog-to-filenode mappings.
AsyncCtlLockWaiting to read or update the shared notification state.
AsyncQueueLockWaiting to read or update notification messages.
SerializableXactHashLockWaiting to retrieve or store information about serializable transactions.
SerializableFinishedListLockWaiting to access the list of finished serializable transactions.
SerializablePredicateLockListLockWaiting to perform operations on locks held by serializable transactions.
OldSerXidLockWaiting to read or record conflicting serializable transactions.
SyncRepLockWaiting to read or update information about synchronous replicas.
BackgroundWorkerLockWaiting to read or update the background worker state.
DynamicSharedMemoryControlLockWaiting to read or update the dynamic shared memory state.
AutoFileLockWaiting to update the postgresql.auto.conf file.
ReplicationSlotAllocationLockWaiting to allocate or drop a replication slot.
ReplicationSlotControlLockWaiting to read or update the state of a replication slot.
CommitTsControlLockWaiting to read or update transaction commit timestamps.
CommitTsLockWaiting to read or update the last transaction timestamp value.
ReplicationOriginLockWaiting to set up, drop, or use a replication origin.
MultiXactTruncationLockWaiting to read or truncate multixact information.
OldSnapshotTimeMapLockWaiting to read or update control information about old snapshots.
BackendRandomLockWaiting to generate a random number.
LogicalRepWorkerLockWaiting for an action on a logical replication worker to complete.
CLogTruncationLockWaiting to truncate a WAL file, or waiting for an in-progress WAL truncation to complete.
clogWaiting for I/O on a commit log (CLOG) buffer. A CLOG records the commit status of transactions.
commit_timestampWaiting for I/O on a commit timestamp buffer.
subtransWaiting for I/O on a subtransaction buffer.
multixact_offsetWaiting for I/O on a multixact offset buffer.
multixact_memberWaiting for I/O on a multixact member buffer.
asyncWaiting for I/O on an async buffer.
oldserxidWaiting for I/O on an oldserxid buffer.
wal_insertWaiting to insert a WAL record into a memory buffer.
buffer_contentWaiting to read or write a data page in memory.
buffer_ioWaiting for I/O on a data page.
replication_originWaiting to read or update replication progress.
replication_slot_ioWaiting for I/O on a replication slot.
procWaiting to read or update fast-path lock information.
buffer_mappingWaiting to associate a data block with a buffer in the buffer pool.
lock_managerWaiting to join or exit a locking group, or to add or check locks used by backends. Occurs during parallel queries.
predicate_lock_managerWaiting to add or check predicate lock information.
parallel_query_dsaWaiting for the dynamic shared memory allocation lock for parallel execution.
tbmWaiting for the shared iterator lock on a TIDBitmap.
parallel_appendWaiting to select the next subplan while executing a Parallel Append plan.
parallel_hash_joinWaiting to allocate or exchange memory chunks, or to update counters while executing a Parallel Hash plan.
LockrelationWaiting to acquire a lock on a relation.
extendWaiting to extend a relation.
pageWaiting to acquire a lock on a relation page.
tupleWaiting to acquire a lock on a tuple.
transactionidWaiting for a transaction to complete.
virtualxidWaiting to acquire a virtual XID lock.
speculative tokenWaiting to acquire a speculative insertion lock.
objectWaiting to acquire a lock on a non-relational database object.
userlockWaiting to acquire a user lock.
advisoryWaiting to acquire an advisory lock.
BufferPinBufferPinWaiting to pin a buffer.
ActivityArchiverMainWaiting in the main loop of the archiver process.
AutoVacuumMainWaiting in the main loop of the autovacuum launcher process.
BgWriterHibernateWaiting in the background writer process while the instance is in hibernation.
BgWriterMainWaiting in the main loop of the background writer process.
CheckpointerMainWaiting in the main loop of the checkpointer process.
LogicalApplyMainWaiting in the main loop of the logical replication apply process.
LogicalLauncherMainWaiting in the main loop of the logical replication launcher process.
PgStatMainWaiting in the main loop of the statistics collector process.
RecoveryWalAllWaiting for WAL data from any source (local file, archive, or stream) during instance recovery.
RecoveryWalStreamWaiting for WAL data from a stream during instance recovery.
SysLoggerMainWaiting in the main loop of the syslog process.
WalReceiverMainWaiting in the main loop of the WAL receiver process.
WalSenderMainWaiting in the main loop of the WAL sender process.
WalWriterMainWaiting in the main loop of the WAL writer process.
ClientClientReadWaiting to read data from the client.
ClientWriteWaiting to write data to the client.
LibPQWalReceiverConnectWaiting in the WAL receiver process to connect to a remote server.
LibPQWalReceiverReceiveWaiting in the WAL receiver process to receive data from a remote server.
SSLOpenServerWaiting for SSL handshake during connection establishment.
WalReceiverWaitStartWaiting for the startup process to send initial data for streaming replication.
WalSenderWaitForWALWaiting for WAL data to be flushed in the WAL sender process.
WalSenderWriteDataWaiting while processing replies from the WAL receiver in the WAL sender process.
ExtensionExtensionWaiting in an extension module.
IPCBgWorkerShutdownWaiting for a background worker to shut down.
BgWorkerStartupWaiting for a background worker to start up.
BtreePageWaiting for a page number needed to continue a parallel B-tree scan.
ClogGroupUpdateWaiting for the group leader to update transaction status when a transaction ends.
ExecuteGatherWaiting for activity from a child process while executing a Gather node.
Hash/Batch/AllocatingWaiting for the elected Parallel Hash participant to allocate hash tables.
Hash/Batch/ElectingWaiting for a Parallel Hash participant to be elected to allocate hash tables.
Hash/Batch/LoadingWaiting for other Parallel Hash participants to finish loading hash tables.
Hash/Build/AllocatingWaiting for the elected Parallel Hash participant to allocate the initial hash table.
Hash/Build/ElectingWaiting for a Parallel Hash participant to be elected to allocate the initial hash table.
Hash/Build/HashingInnerWaiting for other Parallel Hash participants to finish hashing inner relations.
Hash/Build/HashingOuterWaiting for other Parallel Hash participants to finish hashing outer relations.
Hash/GrowBatches/AllocatingWaiting for the elected Parallel Hash participant to allocate additional hash table batches.
Hash/GrowBatches/DecidingWaiting for a Parallel Hash participant to be elected to decide the batch count increase.
Hash/GrowBatches/ElectingWaiting for a Parallel Hash participant to be elected to allocate additional batches.
Hash/GrowBatches/FinishingWaiting for the elected Parallel Hash participant to decide the batch count increase.
Hash/GrowBatches/RepartitioningWaiting for other Parallel Hash participants to finish repartitioning.
Hash/GrowBuckets/AllocatingWaiting for the elected Parallel Hash participant to finish allocating additional buckets.
Hash/GrowBuckets/ElectingWaiting for a Parallel Hash participant to be elected to allocate additional buckets.
Hash/GrowBuckets/ReinsertingWaiting for other Parallel Hash participants to insert tuples into new buckets.
LogicalSyncDataWaiting for the remote logical replication server to send data for initial table synchronization.
LogicalSyncStateChangeWaiting for the remote logical replication server to change state.
MessageQueueInternalWaiting for other processes to attach to a shared message queue.
MessageQueuePutMessageWaiting to write a protocol message to a shared message queue.
MessageQueueReceiveWaiting to receive bytes from a shared message queue.
MessageQueueSendWaiting to send bytes to a shared message queue.
ParallelBitmapScanWaiting for a parallel bitmap scan to be initialized.
ParallelCreateIndexScanWaiting for parallel CREATE INDEX workers to finish heap scans.
ParallelFinishWaiting for parallel workers to finish computing.
ProcArrayGroupUpdateWaiting for the group leader to clear the XID after a transaction completes.
ReplicationOriginDropWaiting for a replication origin to become inactive so it can be deleted.
ReplicationSlotDropWaiting for a replication slot to become inactive so it can be deleted.
SafeSnapshotWaiting for a snapshot usable in a READ ONLY DEFERRABLE transaction.
SyncRepWaiting for confirmation from the remote server during synchronous replication.
TimeoutBaseBackupThrottleWaiting during the base backup phase while throttling is active.
PgSleepWaiting in a process that called the pg_sleep function.
RecoveryApplyDelayWaiting to apply WAL during recovery because WAL application is delayed.
IOBufFileReadWaiting to read data from a buffered file.
BufFileWriteWaiting to write data to a buffered file.
ControlFileReadWaiting to read data from the control file.
ControlFileSyncWaiting for the control file to reach stable storage.
ControlFileSyncUpdateWaiting for a control file update to reach stable storage.
ControlFileWriteWaiting to write data to the control file.
ControlFileWriteUpdateWaiting to write an update to the control file.
CopyFileReadWaiting to read data while copying a file.
CopyFileWriteWaiting to write data while copying a file.
DataFileExtendWaiting for a relation data file to be extended.
DataFileFlushWaiting for a relation data file to reach stable storage.
DataFileImmediateSyncWaiting for a relation data file to be immediately synced to stable storage.
DataFilePrefetchWaiting for an asynchronous prefetch from a relation data file.
DataFileReadWaiting to read data from a relation data file.
DataFileSyncWaiting for changes to a relation data file to reach stable storage.
DataFileTruncateWaiting for a relation data file to be truncated.
DataFileWriteWaiting to write data to a relation data file.
DSMFillZeroWriteWaiting to write zeros to a dynamic shared memory backing file.
LockFileAddToDataDirReadWaiting to read data while adding a row to the data directory lock file.
LockFileAddToDataDirSyncWaiting for a row to reach stable storage while adding it to the data directory lock file.
LockFileAddToDataDirWriteWaiting to write data while adding a row to the data directory lock file.
LockFileCreateReadWaiting to read data while creating the data directory lock file.
LockFileCreateSyncWaiting for data to reach stable storage while creating the data directory lock file.
LockFileCreateWriteWaiting to write data while creating the data directory lock file.
LockFileReCheckDataDirReadWaiting to read data while rechecking the data directory lock file.
LogicalRewriteCheckpointSyncWaiting for logical rewrite mappings to reach stable storage during a checkpoint.
LogicalRewriteMappingSyncWaiting for mapping data to reach stable storage during a logical rewrite.
LogicalRewriteMappingWriteWaiting to write mapping data during a logical rewrite.
LogicalRewriteSyncWaiting for logical rewrite mappings to reach stable storage.
LogicalRewriteWriteWaiting to write data to logical rewrite mappings.
RelationMapReadWaiting to read data from the relation mapping file.
RelationMapSyncWaiting for the relation mapping file to reach stable storage.
RelationMapWriteWaiting to write data to the relation mapping file.
ReorderBufferReadWaiting to read data during reorder buffer management.
ReorderBufferWriteWaiting to write data during reorder buffer management.
ReorderLogicalMappingReadWaiting to read a logical mapping during reorder buffer management.
ReplicationSlotReadWaiting to read data from a replication slot control file.
ReplicationSlotRestoreSyncWaiting for a replication slot control file to reach stable storage while it is being restored into memory.
ReplicationSlotSyncWaiting for a replication slot control file to reach stable storage.
ReplicationSlotWriteWaiting to write data to a replication slot control file.
SLRUFlushSyncWaiting for Segmented Least Recently Used (SLRU) data to reach stable storage during a checkpoint or database shutdown.
SLRUReadWaiting to read data from an SLRU page.
SLRUSyncWaiting for SLRU data to reach stable storage after a page write.
SLRUWriteWaiting to write data to an SLRU page.
SnapbuildReadWaiting to read data from a serialized historical catalog snapshot.
SnapbuildSyncWaiting for a serialized historical catalog snapshot to reach stable storage.
SnapbuildWriteWaiting to write data to a serialized historical catalog snapshot.
TimelineHistoryFileSyncWaiting for a timeline history file received via streaming replication to reach stable storage.
TimelineHistoryFileWriteWaiting to write a timeline history file received via streaming replication.
TimelineHistoryReadWaiting to read data from a timeline history file.
TimelineHistorySyncWaiting for a newly created timeline history file to reach stable storage.
TimelineHistoryWriteWaiting to write data to a newly created timeline history file.
TwophaseFileReadWaiting to read data from a two-phase state file.
TwophaseFileSyncWaiting for a two-phase state file to reach stable storage.
TwophaseFileWriteWaiting to write data to a two-phase state file.
WALBootstrapSyncWaiting for WAL data to reach stable storage during bootstrapping.
WALBootstrapWriteWaiting to write data to a WAL page during bootstrapping.
WALCopyReadWaiting to read data while creating a WAL segment by copying an existing segment.
WALCopySyncWaiting for a WAL segment created by copying an existing segment to reach stable storage.
WALCopyWriteWaiting to write data while creating a WAL segment by copying an existing segment.
WALInitSyncWaiting for a newly initialized WAL file to reach stable storage.
WALInitWriteWaiting to write data while initializing a new WAL file.
WALReadWaiting to read data from a WAL file.
WALSenderTimelineHistoryReadWaiting to read a timeline history file while running the walsender timeline command.
WALSyncMethodAssignWaiting for data to reach stable storage while assigning the WAL sync method.
WALWriteWaiting to write data to a WAL file.

polar_stat_activity_rt

The polar_stat_activity_rt view provides real-time status data for all backend processes. Unlike polar_stat_activity, this view does not provide cumulative totals.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
pidintegerThe process ID.
backend_typetextThe type of the backend process.
cpu_userbigintThe user CPU usage of the backend.
cpu_sysbigintThe system CPU usage of the backend.
rssbigintThe memory usage of the backend, in bytes.
local_read_psbigintThe cumulative number of read operations on the local file system.
local_write_psbigintThe cumulative number of write operations on the local file system.
local_read_throughputbigintThe cumulative read throughput of the local file system, in bytes.
local_write_throughputbigintThe cumulative write throughput of the local file system, in bytes.
local_read_latency_msdoubleThe read latency for local file system operations, in milliseconds.
local_write_latency_msdoubleThe write latency for local file system operations, in milliseconds.

polar_delta

polar_delta is a function that queries the incremental (delta) values of a view between successive calls.

Important

polar_delta is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.

To use polar_delta:

  1. Create a view with a dimension column and one or more value columns.

    • Dimension column names must start with d.

    • Value column names must start with v.

  2. Query the view using one of the following statements:

    SELECT * FROM polar_delta(NULL::view_name);
    \watch 1 SELECT * FROM polar_delta(NULL::view_name);

Resources

Shared memory

Global data structures such as the buffer pool and latches are allocated in shared memory at startup. The following views provide shared memory monitoring information.

polar_stat_shmem

The polar_stat_shmem view provides detailed monitoring information for each type of shared memory.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
shmnametextThe name of the shared memory segment.
shmsizebigintThe size of the shared memory segment, in bytes.
shmtypetextThe type of the shared memory segment.

polar_stat_shmem_total_size

The polar_stat_shmem_total_size view provides aggregated monitoring information about shared memory, grouped by type.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
shmsizebigintThe total size of the shared memory type, in bytes.
shmtypetextThe type of the shared memory.

Session private memory

PolarDB dynamically allocates and releases private memory during execution. Session-level memory metrics are available in the polar_stat_activity view. For context-level memory details, use the following function and view.

polar_get_mcxt()

The polar_get_mcxt() function returns memory context information for a given backend process.

ParameterTypeDescription
pidintegerThe ID of the session process.
nametextThe name of the memory context.
levelintThe level of the memory context.
nblocksbigintThe number of allocated blocks.
freechunksbigintThe number of free chunks.
totalspacebigintThe total memory allocated, in bytes.
freespacebigintThe free memory available, in bytes.

polar_backends_mcxt

The polar_backends_mcxt view provides memory context information grouped by backend type.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
pidintegerThe process ID.
nametextThe name of the memory context.
nblocksbigintThe number of allocated blocks.
freechunksbigintThe number of free chunks.
totalspacebigintThe total memory allocated, in bytes.
freespacebigintThe free memory available, in bytes.

I/O

Session-level I/O metrics are available in the polar_stat_activity view. The following views provide file-level I/O statistics and latency distribution.

polar_stat_io_info

The polar_stat_io_info view provides I/O monitoring information grouped by file type.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
filetypetextThe type of the file.
fileloctextThe file system where the file resides. Valid values: local file system, Polar File System (PFS).
open_countnumericThe number of times the file has been opened.
open_latency_usdoubleThe total latency for opening the file, in microseconds.
close_countnumericThe number of times the file has been closed.
read_countnumericThe number of times the file has been read.
write_countnumericThe number of times the file has been written.
read_throughputnumericThe cumulative read throughput of the file system, in bytes.
write_throughputnumericThe cumulative write throughput of the file system, in bytes.
read_latency_usdoubleThe total latency for reading the file, in microseconds.
write_latency_usdoubleThe total latency for writing to the file, in microseconds.
seek_countnumericThe number of times seek() was called.
seek_latency_usdoubleThe total latency for seek() calls, in microseconds.
creat_countnumericThe number of times a file was created.
creat_latency_usdoubleThe total latency for file creation, in microseconds.
fsync_countnumericThe number of times fsync() was called.
fsync_latency_usdoubleThe total latency for fsync() calls, in microseconds.
falloc_countnumericThe number of times fallocate() was called.
falloc_latency_usdoubleThe total latency for fallocate() calls, in microseconds.

polar_stat_io_latency

The polar_stat_io_latency view provides I/O latency distribution grouped by operation type.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
iokindtextThe I/O operation type. Valid values: fsync, creat, seek, open, read, write, falloc.
num_lessthan200usnumericThe number of operations with latency less than 200 microseconds.
num_lessthan400usnumericThe number of operations with latency between 200 and 400 microseconds.
num_lessthan600usnumericThe number of operations with latency between 400 and 600 microseconds.
num_lessthan800usnumericThe number of operations with latency between 600 and 800 microseconds.
num_lessthan1msnumericThe number of operations with latency between 800 microseconds and 1 millisecond.
num_lessthan10msnumericThe number of operations with latency between 1 and 10 milliseconds.
num_lessthan100msnumericThe number of operations with latency between 10 and 100 milliseconds.
num_morethan100msnumericThe number of operations with latency greater than 100 milliseconds.

Network

The following function and view provide network monitoring information.

polar_proc_stat_network()

The polar_proc_stat_network() function returns per-process network statistics.

ParameterTypeDescription
pidbigintThe process ID.
send_bytesbigintThe total number of bytes sent.
send_countbigintThe cumulative number of send operations.
recv_bytesbigintThe total number of bytes received.
recv_countbigintThe cumulative number of receive operations.
sendqbigintThe send queue length on the socket.
recvqbigintThe receive queue length on the socket.
cwndbigintThe congestion window size of the socket.
rttbigintThe round-trip time (RTT) of TCP packets, in microseconds.
retransbigintThe cumulative number of TCP retransmissions.
tcpinfo_update_timebigintThe Unix timestamp (in seconds) of the last update to TCP socket metrics. The sendq, recvq, cwnd, rtt, and retrans values are updated once per second; this field shows when they were last refreshed.

Lock

The following views provide lock monitoring information.

polar_stat_lwlock

The polar_stat_lwlock view provides lightweight lock (LWLock) statistics.

This view is provided by the polar_monitor_preload plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor_preload.
ParameterTypeDescription
tranchesmallintThe lock ID.
nametextThe lock name.
sh_acquire_countbigintThe number of times a shared lock was acquired.
ex_acquire_countbigintThe number of times an exclusive lock was acquired.
block_countbigintThe number of lock blocks that occurred.
lock_numsbigintThe number of lightweight locks.
wait_timebigintThe total lock wait time.

pg_locks

The pg_locks view provides information about heavyweight locks held or awaited by server processes.

ParameterTypeDescription
locktypetextThe type of the lockable object. Valid values: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, advisory.
databaseoidThe OID of the database in which the locked object resides. Returns 0 for shared objects and NULL for XID locks.
relationoidThe OID of the relation being locked. Returns NULL if the object is not a relation or is only part of a relation.
pageintegerThe page number within the relation. Returns NULL if the object is not a tuple or relation page.
tuplesmallintThe tuple number within the page. Returns NULL if the object is not a tuple.
virtualxidtextThe virtual transaction ID being locked. Returns NULL if the object is not a virtual XID.
transactionidxidThe transaction ID being locked. Returns NULL if the object is not an XID.
classidoidThe OID of the system catalog containing the locked object. Returns NULL if the object is not a general database object.
objidoidThe ID of the locked object within the system catalog. Returns NULL if the object is not a general database object.
objsubidsmallintThe ID of the locked column. The values in classid and objid refer to the table itself. Returns 0 for other general database objects, and NULL if the object is not a general database object.
virtualtransactiontextThe virtual transaction ID of the transaction holding or awaiting the lock.
pidintegerThe PID of the server process holding or awaiting the lock. Returns NULL if the lock is held by a prepared transaction.
modetextThe name of the lock mode held or requested by this process.
grantedbooleantrue if the lock is held; false if the lock is being waited for.
fastpathbooleantrue if the lock was acquired via the fast path; false if it was acquired from the main lock table.

polar_stat_lock

The polar_stat_lock view provides lock statistics aggregated by lock type.

This view is provided by the polar_monitor_preload plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor_preload.
ParameterTypeDescription
idintegerThe primary key.
lock_typetextThe type of the lock.
invalidnumericIndicates that the lock is invalid.
accesssharelocknumericThe number of ACCESS SHARE locks.
rowsharelocknumericThe number of ROW SHARE locks.
rowexclusivelocknumericThe number of ROW EXCLUSIVE locks.
shareupdateexclusivelocknumericThe number of SHARE UPDATE EXCLUSIVE locks.
sharelocknumericThe number of SHARE locks.
sharerowexclusivelocknumericThe number of SHARE ROW EXCLUSIVE locks.
exclusivelocknumericThe number of EXCLUSIVE locks.
accessexclusivelocknumericThe number of ACCESS EXCLUSIVE locks.
block_countnumericThe number of lock blocks caused by lock contention.
fastpath_countnumericThe number of fast-path locks acquired locally.
wait_timenumericThe total lock wait time.

SLRU

The polar_stat_slru() view provides monitoring information about Segmented Least Recently Used (SLRU) cache data.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
slru_typetextThe SLRU type (primary key).
slots_numberintegerThe total number of page slots.
valid_pagesintegerThe number of pages in use.
empty_pagesintegerThe number of empty pages.
reading_pagesintegerThe number of pages currently being read.
writing_pagesintegerThe number of pages currently being written.
wait_readingsintegerThe number of wait events for read operations.
wait_writingsintegerThe number of wait events for write operations.
read_countbigintThe total number of read operations.
read_only_countbigintThe number of read-only operations.
read_upgrade_countbigintThe number of read operations in upgrade mode.
victim_countbigintThe number of cache evictions.
victim_write_countbigintThe number of cache evictions that required writing evicted data to disk.
write_countbigintThe total number of write operations.
zero_countbigintThe number of times cache data was cleared.
flush_countbigintThe total number of flush operations.
truncate_countbigintThe total number of truncate operations.
storage_read_countbigintThe number of times data was read from disk.
storage_write_countbigintThe number of times data was written to disk.

cgroup

The following views provide system resource and cgroup monitoring information.

polar_stat_cgroup

The polar_stat_cgroup view provides statistics about system resources and control groups (cgroups).

This view is provided by both the polar_monitor_preload and polar_monitor plugins, which are built into PolarDB for PostgreSQL. To activate the plugins, run CREATE EXTENSION polar_monitor_preload and CREATE EXTENSION polar_monitor.
ParameterTypeDescription
subtypetextThe cgroup type. Valid values: IO, Memory, CPU.
infotypetextThe cgroup metric being reported.
countbigintThe resource usage count.

polar_cgroup_quota

The polar_cgroup_quota view provides cgroup quota information.

This view is provided by the polar_monitor plugin, which is built into PolarDB for PostgreSQL. To activate the plugin, run CREATE EXTENSION polar_monitor.
ParameterTypeDescription
subtypetextThe cgroup type. Valid values: IO, Memory, CPU.
infotypetextThe cgroup metric being reported.
countbigintThe cgroup quota value.