This topic describes the views in PolarDB O Edition. You can query views to obtain instance details. This helps you troubleshoot performance issues.

Resources

  • CPU

    You can query the polar_stat_cpu_backend view to obtain information about CPU resources.

    polar_stat_cpu_backend

    Provides information about CPU utilization based on backend_type. The following table describes the parameters.
    Parameter Type Description
    backend_type text The type of the process.
    cpu_user bigint The user CPU time. Unit: clock ticks.
    cpu_sys bigint The system CPU time. Unit: clock ticks.
    rss bigint The resident set size (RSS). Unit: bytes.
    Note The polar_stat_cpu_backend view works together with the polar_monitor_preload plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor_preload statement.
  • Memory

    You can query the following views to obtain memory information.

    • polar_backends_mcxt

      Provides memory context information based on backend_type. The following table describes the parameters.
      Parameter Type Description
      pid integer The ID of the process.
      name text The name of the memory context.
      nblocks bigint The number of the occupied blocks.
      freechunks bigint The number of the free blocks.
      totalspace bigint The total memory. Unit: bytes.
      freespace bigint The free memory. Unit: bytes.
      Note The polar_backends_mcxt view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
    • polar_stat_shmem

      Provides monitoring information about shared memory. The following table describes the parameters.
      Parameter Type Description
      shmname text The name of the shared memory.
      shmsize bigint The size of the shared memory. Unit: bytes.
      shmtype text The type of the shared memory.
      Note The polar_stat_shmem view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
    • polar_stat_shmem_total_size

      Summarizes monitoring information about shared memory. The following table describes the parameters.
      Parameter Type Description
      shmsize bigint The size of the shared memory. Unit: bytes.
      shmtype text The type of the shared memory.
      Note The polar_stat_shmem_total_size view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
  • I/O

    You can query the following views to obtain monitoring information about the I/O requests and I/O latency.

    • polar_stat_io_info
      Provides monitoring information about I/O requests based on filetype. The following table describes the parameters.
      Parameter Type Description
      filetype text The type of the file.
      fileloc text The file system in which the file is stored.
      open_count numeric The number of times that you open the file.
      open_latency_us double The total latency for opening the file.
      close_count numeric The number of times that you close the file.
      read_count numeric The number of times that you read the file.
      write_count numeric The number of times that you write data to the file.
      read_throughput numeric The read throughput of the file system.
      write_throughput numeric The write throughput of the file system.
      read_latency_us double The total latency for reading the file. Unit: microseconds.
      write_latency_us numeric The total latency for writing data to the file. Unit: microseconds.
      seek_count numeric The number of times that you call the seek() function.
      seek_latency_us double The total latency for calling the seek() function.
      creat_count numeric The number of times that you create a file.
      creat_latency_us double The total latency for creating a file.
      fsync_count numeric The number of times that you call the fsync() function.
      fsync_latency_us double The total latency for calling the fsync() function.
      falloc_count numeric The number of times that you call the fallocate() function.
      falloc_latency_us double The total latency for calling the fallocate() function.
      Note The polar_stat_io_info view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
    • polar_stat_io_latency
      Provides information about the I/O latency based on iokind. The following table describes the parameters.
      Parameter Type Description
      iokind text The type of the operation on a file. Valid values:
      • fsync :
      • creat: creates a file.
      • seek :
      • open: opens a file.
      • read: reads a file.
      • write: writes data to a file.
      • falloc :
      num_lessthan200us numeric The number of times that the I/O latency is less than 200 microseconds.
      num_lessthan400us numeric The number of times that the I/O latency is greater than 200 microseconds but less than 400 microseconds.
      num_lessthan600us numeric The number of times that the I/O latency is greater than 400 microseconds but less than 600 microseconds.
      num_lessthan800us numeric The number of times that the I/O latency is greater than 600 microseconds but less than 800 microseconds.
      num_lessthan1ms numeric The number of times that the I/O latency is greater than 800 microseconds but less than 1 millisecond.
      num_lessthan10ms numeric The number of times that the I/O latency is greater than 1 millisecond but less than 10 milliseconds.
      num_lessthan100ms numeric The number of times that the I/O latency is greater than 10 milliseconds but less than 100 milliseconds.
      num_morethan100ms numeric The number of times that the I/O latency is greater than 100 milliseconds.
      Note The polar_stat_io_latency view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
    • polar_stat_io_backend
      Provides monitoring information about I/O requests based on backend_type. The following table describes the parameters.
      Parameter Type Description
      backend_type text The type of the backend process.
      pfs_read_ps bigint The number of read operations on a Polar file system (PFS).
      pfs_write_ps bigint The number of write operations on a PFS.
      pfs_read_throughput bigint The read throughput of a PFS. Unit: bytes.
      pfs_write_throughput bigint The write throughput of a PFS. Unit: bytes.
      pfs_read_latency double precision The read latency of a PFS. Unit: microseconds.
      pfs_write_latency double precision The write latency of a PFS. Unit: microseconds.
      local_read_ps bigint The number of read operations on a local file system.
      local_write_ps bigint The number of write operations on a local file system.
      local_read_throughput bigint The read throughput of a local file system. Unit: bytes.
      local_write_throughput bigint The write throughput of a local file system. Unit: bytes.
      local_read_latency double precision The read latency of a local file system. Unit: microseconds.
      local_write_latency double precision The write latency of a local file system. Unit: microseconds.
      Note The polar_stat_io_backend view works together with the polar_monitor_preload plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor_preload statement.
  • Network

    You can query the following views to obtain network monitoring information.

    • polar_stat_network
      Summarizes network monitoring information. The following table describes the parameters.
      Parameter Type Description
      send_count bigint The number of times that the system sends network traffic.
      send_bytes bigint The amount of outbound traffic. Unit: bytes.
      recv_count bigint The number of times that the system receives network traffic.
      recv_bytes bigint The amount of inbound traffic. Unit: bytes.
      retrans bigint The number of times that data is retransmitted.
      Note The polar_stat_network view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
    • polar_stat_network_backend
      Provides network monitoring information based on backend_type. The following table describes the parameters.
      Parameter Type Description
      backend_type text The type of the backend process.
      send_count bigint The number of times that the system sends network traffic.
      send_bytes bigint The amount of outbound traffic. Unit: bytes.
      recv_count bigint The number of times that the system receives network traffic.
      recv_bytes bigint The amount of inbound traffic. Unit: bytes.
      Note The polar_stat_network_backend view works together with the polar_monitor_preload plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor_preload statement.
  • Lock

    You can query the following views to obtain lock information.

    • LWLock

      polar_stat_lwlock

      Provides monitoring information about locks. The following table describes the parameters.
      Parameter Type Description
      tranche smallint lwlock ID
      name text The name of the lock.
      sh_acquire_count bigint The number of times that the system acquires a shared lock.
      ex_acquire_count bigint The number of times that the system acquires an exclusive lock.
      block_count bigint The number of blocks that occur.
      lock_nums bigint The number of lightweight locks.
      wait_time bigint The total lock wait time.
      Note The polar_stat_lwlock view works together with the polar_monitor_preload plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor_preload statement.
    • Lock

      polar_stat_lock

      Provides lock statistics. The following table describes the parameters.
      Parameter Type Description
      id integer The primary key of the table.
      lock_type text The type of the lock.
      invalid numeric Indicates that the lock is invalid.
      accesssharelock numeric The number of ACCESS SHARE locks.
      rowsharelock numeric The number of ROW SHARE locks.
      rowexclusivelock numeric The number of ROW EXCLUSIVE locks.
      shareupdateexclusivelock numeric The number of SHARE UPDATE EXCLUSIVE locks.
      sharelock numeric The number of SHARE locks.
      sharerowexclusivelock numeric The number of SHARE ROW EXCLUSIVE locks.
      exclusivelock numeric The number of EXCLUSIVE locks.
      accessexclusivelock numeric The number of ACCESS EXCLUSIVE locks.
      block_count numeric The number of blocks caused by locks.
      fastpath_count numeric The number of fast-path locks on a local system.
      wait_time numeric The lock wait time.
      Note The polar_stat_lock view works together with the polar_monitor_preload plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor_preload statement.
  • Slru

    You can query the polar_stat_slru() view to obtain monitoring information about Simple Least Recently Used (SLRU) cache data.

    polar_stat_slru()

    Provides monitoring information about SLRU cache data. The following table describes the parameters.
    Parameter Type Description
    slru_type text The primary key of the table.
    slots_number integer The number of pages.
    valid_pages integer The number of the used pages.
    empty_pages integer The number of the empty pages.
    reading_pages integer The number of the pages on which the read operations are being performed.
    writing_pages integer The number of the pages on which the write operations are being performed.
    wait_readings integer The number of the wait events for read operations.
    wait_writings integer The number of the wait events for write operations.
    read_count bigint The number of the read operations.
    read_only_count bigint The number of the read-only operations.
    read_upgrade_count bigint The number of the read operations in upgrade mode.
    victim_count bigint The number of times that data is evicted from caches.
    victim_write_count bigint The number of times that data is evicted from caches and then is written to disks.
    write_count bigint The number of the write operations.
    zero_count bigint The number of times that the cache data is cleared.
    flush_count bigint The number of the flush operations.
    truncate_count bigint The number of the truncate operations.
    storage_read_count bigint The number of times that you read data on disks.
    storage_write_count bigint The number of times that you write data to disks.
    Note The polar_stat_slru view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
  • cgroup

    You can query the following views to obtain information about system resources.

    • polar_stat_cgroup

      Provides statistics about system resources and control groups (cgroups). The following table describes the parameters.

      Parameter Type Description
      subtype text The type of a cgroup. Valid values: IO, Memory, and CPU.
      infotype text The information about cgroups.
      count bigint The statistics about the used resources.
      Note The polar_stat_cgroup view works together with the polar_monitor_preload and polar_monitor plug-ins. The polar_monitor_preload and polar_monitor plug-ins are built into PolarDB O Edition. To activate the plug-ins, execute the create extension polar_monitor_preload and create extension polar_monitor statements.
    • polar_cgroup_quota
      Provides statistics about system resources and cgroup quotas. The following table describes the parameters.
      Parameter Type Description
      subtype text The type of a cgroup. Valid values: IO, Memory, and CPU.
      infotype text The information about cgroups.
      count bigint The quota of a cgroup.
      Note The polar_cgroup_quota view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.

Activity status

  • polar_stat_activity
    Provides the status of each process. The polar_stat_activity view provides a cumulative sum for each process.
    Parameter Type Description
    datid oid The object identifier (OID) in the database.
    datname name The name of the database.
    pid integer The ID of the process.
    usesysid oid The ID of the user.
    usename name The username.
    application_name text The name of the client that is connected to the database.
    client_addr inet The IP address of the client.
    client_hostname text The name of the host on which the client runs.
    client_port integer The port used by the client.
    backend_start timestamp The time when the connection between the client and the database is established.
    xact_start timestamp The start time of the transaction.
    query_start timestamp The start time when the SQL statement is executed.
    state_change timestamp The time when the status of the process is changed.
    wait_event_type text The type of the wait event. If the backend is not waiting for an event, NULL is returned. Valid values:
    • LWLock: The backend is waiting for a lightweight lock. A lightweight lock protects a special data structure in shared memory. wait_event: contains a name that identifies the purpose of the lightweight lock. Some locks have specific names. Other locks are a group of locks each with a similar purpose.
    • Lock: The backend is waiting for a heavyweight lock. A heavyweight lock is also referred to as a lock manager or a simple lock. A heavyweight lock protects SQL objects such as tables. The SQL objects are visible to users. A heavyweight lock is also used to ensure mutual exclusion for some internal operations such as table extension. wait_event identifies the type of the lock wait event.
    • BufferPin: The server process is waiting to access a data buffer during a period when no other process is checking that buffer. Buffer pin waits can be protracted if another process holds an open cursor that last reads data from the buffer.
    • Activity: The server process is idle. This parameter is used when a system process waits for an activity in the main processing loop. wait_event identifies the specific wait point.
    • Extension: The server process is waiting for an activity in an extension module. This category is useful for modules to track custom wait points.
    • Client: The server process is waiting for an activity on a socket from user applications. The server also expects events that are independent of the internal processes to happen. wait_event identifies the specific wait point.
    • IPC: The server process is waiting for an activity from another process in the server. wait_event identifies the specific wait point.
    • Timeout: The server process is waiting for a timeout. wait_event identifies the specific wait point.
    • IO: The server process is waiting for an I/O request to complete. wait_event identifies the specific wait point.
    wait_event text The name of the wait event. If the backend is not waiting for an event, NULL is returned.
    state text The status of the backend server.
    backend_xid xid The transaction identifier (XID) of the client.
    backend_xmin xid The xmin value of the client.
    query text The SQL statement.
    backend_type text The type of the backend process.
    queryid bigint The unique ID of the SQL statement.
    wait_object text The wait object. This parameter is returned when the backend is waiting for an event.
    wait_type text The type of the wait object. This parameter is returned when the backend is waiting for an event.
    wait_time_ms double The wait time that lapses. This parameter is returned when the backend is waiting for an event.
    cpu_user bigint The user CPU time of the backend server.
    cpu_sys bigint The system CPU time of the backend server.
    rss bigint The used memory of the backend server.
    pfs_read_ps bigint The cumulative sum of read operations on a PFS.
    pfs_write_ps bigint The cumulative sum of write operations on a PFS.
    pfs_read_throughput bigint The read throughput of a PFS. A cumulative sum is returned.
    pfs_write_throughput bigint The write throughput of a PFS. A cumulative sum is returned.
    pfs_read_latency_ms double The latency of the read operation on a PFS.
    pfs_write_latency_ms double The latency of the write operation on a PFS.
    local_read_ps bigint The cumulative sum of read operations on a local file system.
    local_write_ps bigint The cumulative sum of write operations on a local file system.
    local_read_throughput bigint The read throughput of a local file system. A cumulative sum is returned.
    local_write_throughput bigint The write throughput of a local file system. A cumulative sum is returned.
    local_read_latency_ms double The latency of the read operation on a local file system.
    local_write_latency_ms double The latency of the write operation on a local file system.
    Wait events
    Wait event type Wait event name Description
    LWLock ShmemIndexLock The program is waiting to find or allocate shared memory.
    OidGenLock The program is waiting to allocate or assign an OID.
    XidGenLock The program is waiting to allocate or assign an XID.
    ProcArrayLock The program is waiting to obtain a snapshot or clear an XID at the end of a transaction.
    SInvalReadLock The program is waiting to retrieve or remove a message from a shared invalid message queue.
    SInvalWriteLock The program is waiting to add a message to a shared invalid message queue.
    WALBufMappingLock The program is waiting to replace a page in a Write-Ahead Logging (WAL) buffer.
    WALWriteLock The program is waiting for a WAL buffer to be written to a disk.
    ControlFileLock The program is waiting to read or update the control file or create a WAL file.
    CheckpointLock The program is waiting to perform a checkpoint.
    CLogControlLock The program is waiting to read or update the transaction status.
    SubtransControlLock The program is waiting to read or update sub-transaction information.
    MultiXactGenLock The program is waiting to read or update the shared multixact status.
    MultiXactOffsetControlLock The program is waiting to read or update multixact offset mappings.
    MultiXactMemberControlLock The program is waiting to read or update multixact member mappings.
    RelCacheInitLock The program is waiting to read or write a relation-cache initialization file.
    CheckpointerCommLock The program is waiting to manage fsync() calls.
    TwoPhaseStateLock The program is waiting to read or update the status of a prepared transaction.
    TablespaceCreateLock The program is waiting to create or drop a tablespace.
    BtreeVacuumLock The program is waiting to read or update vacuum-related information for a B-tree index.
    AddinShmemInitLock The program is waiting to manage space allocation in shared memory.
    AutovacuumLock The autovacuum worker or launcher is waiting to update or read the status of the autovacuum worker.
    AutovacuumScheduleLock The program is waiting to ensure that the table selected for a vacuum still needs vacuuming.
    SyncScanLock The program is waiting to obtain the start location of a scan on a table for synchronized scans.
    RelationMappingLock The program is waiting to update the relation map file used to store the catalog to filenode mappings.
    AsyncCtlLock The program is waiting to read or update the shared notification status.
    AsyncQueueLock The program is waiting to read or update notification messages.
    SerializableXactHashLock The program is waiting to retrieve or store information about serializable transactions.
    SerializableFinishedListLock The program is waiting to access finished serializable transactions.
    SerializablePredicateLockListLock The program is waiting to perform an operation on locks held by serializable transactions.
    OldSerXidLock The program is waiting to read or record conflicting serializable transactions.
    SyncRepLock The program is waiting to read or update information about synchronous replicas.
    BackgroundWorkerLock The program is waiting to read or update the backend worker status.
    DynamicSharedMemoryControlLock The program is waiting to read or update the status of the dynamic shared memory.
    AutoFileLock The program is waiting to update the postgresql.auto.conf file.
    ReplicationSlotAllocationLock The program is waiting to allocate or free a replication slot.
    ReplicationSlotControlLock The program is waiting to read or update the status of a replication slot.
    CommitTsControlLock The program is waiting to read or update transaction commit timestamps.
    CommitTsLock The program is waiting to read or update the last value set for the transaction timestamp.
    ReplicationOriginLock The program is waiting to set up, drop, or use the replication origin.
    MultiXactTruncationLock The program is waiting to read or truncate multixact information.
    OldSnapshotTimeMapLock The program is waiting to read or update control information about old snapshots.
    BackendRandomLock The program is waiting to generate a random number.
    LogicalRepWorkerLock The program is waiting for an action on a logical replication worker to complete.
    CLogTruncationLock The program is waiting to truncate a WAL file or waiting for the truncation of a WAL file to complete.
    clog The backend is waiting for I/O requests on a commit log (CLOG) buffer. A CLOG records the commit status of a transaction.
    commit_timestamp The program is waiting for I/O requests on a commit timestamp buffer.
    subtrans The program is waiting for I/O requests on a subtransaction buffer.
    multixact_offset The program is waiting for I/O requests on a multixact offset buffer.
    multixact_member The program is waiting for I/O requests on a multixact member buffer.
    async The program is waiting for I/O requests on an async buffer.
    oldserxid The program is waiting for I/O requests on an oldserxid buffer.
    wal_insert The program is waiting to insert a WAL file into a memory buffer.
    buffer_content The program is waiting to read or write a data page in memory.
    buffer_io The program is waiting for I/O requests on a data page.
    replication_origin The program is waiting to read or update the replication progress.
    replication_slot_io The program is waiting for I/O requests on a replication slot.
    proc The program is waiting to read or update the fast-path lock information.
    buffer_mapping The program is waiting to associate a data block with a buffer in a buffer pool.
    lock_manager The program is waiting to join or exit a locking group, or waiting to add or check the locks that are used for the backend. The event takes place when a parallel query is performed.
    predicate_lock_manager The program is waiting to add or check information about a predicate lock.
    parallel_query_dsa The program is waiting for the dynamic shared memory allocation lock for parallel execution.
    tbm The program is waiting for the shared iterator lock for a TIDBitmap.
    parallel_append The program is waiting to select the next subplan while the Parallel Append plan is being executed.
    parallel_hash_join The program is waiting to allocate or exchange a chunk of memory or update counters while the Parallel Hash plan is being executed.
    Lock relation The program is waiting to obtain the lock on a relation.
    extend The program is waiting to extend a relation.
    page The program is waiting to obtain the lock on the page of a relation.
    tuple The program is waiting to obtain the lock on a tuple.
    transactionid The program is waiting for a transaction to complete.
    virtualxid The program is waiting to obtain a virtual XID lock.
    speculative token The program is waiting to obtain a speculative insertion lock.
    object The program is waiting to obtain the lock on a non-relational database object.
    userlock The program is waiting to obtain a user lock.
    advisory The program is waiting to obtain an advisory user lock.
    BufferPin BufferPin The program is waiting to pin a buffer.
    Activity ArchiverMain The program is waiting in the main loop of the archiver process.
    AutoVacuumMain The program is waiting in the main loop of the autovacuum launcher process.
    BgWriterHibernate The program is waiting in the background writer process while the instance is in hibernation.
    BgWriterMain The program is waiting in the main loop of the background worker of the background worker process.
    CheckpointerMain The program is waiting in the main loop of the checkpointer process.
    LogicalApplyMain The program is waiting in the main loop of the logical apply process.
    LogicalLauncherMain The program is waiting in the main loop of the logical launcher process.
    PgStatMain The program is waiting in the main loop of the statistics collector process.
    RecoveryWalAll The program is waiting for the WAL data from a source, such as a local file, an archived file, or a stream, while the instance is being restored.
    RecoveryWalStream The program is waiting for the WAL data from a stream while the instance is being restored.
    SysLoggerMain The program is waiting in the main loop of the syslog process.
    WalReceiverMain The program is waiting in the main loop of the WAL receiver process.
    WalSenderMain The program is waiting in the main loop of the WAL sender process.
    WalWriterMain The program is waiting in the main loop of the WAL writer process.
    Client ClientRead The program is waiting to read data from the client.
    ClientWrite The program is waiting to write data to the client.
    LibPQWalReceiverConnect The program is waiting in the WAL receiver process to connect to the remote server.
    LibPQWalReceiverReceive The program is waiting in the WAL receiver process to receive data from the remote server.
    SSLOpenServer The program is waiting for SSL while a connection is being established.
    WalReceiverWaitStart The program is waiting for the startup process to send initial data for streaming replication.
    WalSenderWaitForWAL The program is waiting for the WAL data to be flushed in the WAL sender process.
    WalSenderWriteData The program is waiting for an activity that occurs while the replies from the WAL receiver are being processed in the WAL sender process.
    Extension Extension The program is waiting in an extension.
    IPC BgWorkerShutdown The program is waiting for the background worker to shut down.
    BgWorkerStartup The program is waiting for the background worker to start up.
    BtreePage The program is waiting for the page number that is required for continuing to scan B-trees in parallel to become available.
    ClogGroupUpdate The program is waiting for the group leader to update the status of a transaction when the transaction ends.
    ExecuteGather The program is waiting for an activity from a child process while a Gather node is being executed.
    Hash/Batch/Allocating The program is waiting for an elected Parallel Hash participant to allocate hash tables.
    Hash/Batch/Electing The program is waiting for a Parallel Hash participant to be elected to allocate hash tables.
    Hash/Batch/Loading The program is waiting for other Parallel Hash participants to finish loading hash tables.
    Hash/Build/Allocating The program is waiting for an elected Parallel Hash participant to allocate the initial hash table.
    Hash/Build/Electing The program is waiting for a Parallel Hash participant to be elected to allocate the initial hash table.
    Hash/Build/HashingInner The program is waiting for other Parallel Hash participants to complete the hash operations on inner relations.
    Hash/Build/HashingOuter The program is waiting for other Parallel Hash participants to complete the hash operations on outer relations.
    Hash/GrowBatches/Allocating The program is waiting for an elected Parallel Hash participant to allocate more batches of hash tables.
    Hash/GrowBatches/Deciding The program is waiting for a Parallel Hash participant to be elected to determine the increase of batches.
    Hash/GrowBatches/Electing The program is waiting for a Parallel Hash participant to be elected to allocate more batches of hash tables.
    Hash/GrowBatches/Finishing The program is waiting for an elected Parallel Hash participant to determine the increase of batches.
    Hash/GrowBatches/Repartitioning The program is waiting for other Parallel Hash participants to finish repartitioning.
    Hash/GrowBuckets/Allocating The program is waiting for an elected Parallel Hash participant to finish allocating more buckets.
    Hash/GrowBuckets/Electing The program is waiting for a Parallel Hash participant to be elected to allocate more buckets.
    Hash/GrowBuckets/Reinserting The program is waiting for other Parallel Hash participants to finish inserting tuples into new buckets.
    LogicalSyncData The program is waiting for the remote server for logical replication to send data that is used to synchronize the initial table.
    LogicalSyncStateChange The program is waiting for the status of the remote server for logical replication to change.
    MessageQueueInternal The program is waiting for other processes to be added into a shared message queue.
    MessageQueuePutMessage The program is waiting to write a protocol message to a shared message queue.
    MessageQueueReceive The program is waiting to receive bytes from a shared message queue.
    MessageQueueSend The program is waiting to send bytes to a shared message queue.
    ParallelBitmapScan The program is waiting for the parallel scan of a bitmap to be initialized.
    ParallelCreateIndexScan The program is waiting for the CREATE INDEX parallel workers to complete the heap scan.
    ParallelFinish The program is waiting for the parallel workers to finish computing.
    ProcArrayGroupUpdate The program is waiting for the group leader to clear the XID after a transaction is complete.
    ReplicationOriginDrop The program is waiting for a replication origin to become inactive so that the replication origin can be deleted.
    ReplicationSlotDrop The program is waiting for a replication slot to become inactive so that the replication slot can be deleted.
    SafeSnapshot The program is waiting for a snapshot that can be used in a READ ONLY DEFERRABLE transaction.
    SyncRep The program is waiting for a confirmation from the remote server during the synchronous replication.
    Timeout BaseBackupThrottle The program is waiting in the base backup phase while a throttling activity is in progress.
    PgSleep The program is waiting in the process that calls the pg_sleep function.
    RecoveryApplyDelay The program is waiting to apply WAL while data is being restored because WAL is delayed to be applied.
    IO BufFileRead The program is waiting to read data from a buffered file.
    BufFileWrite The program is waiting to write data to a buffered file.
    ControlFileRead The program is waiting to read data from the control file.
    ControlFileSync The program is waiting for the control file to reach stable storage.
    ControlFileSyncUpdate The program is waiting for an update to the control file to reach stable storage.
    ControlFileWrite The program is waiting to write data to the control file.
    ControlFileWriteUpdate The program is waiting to write data to update the control file.
    CopyFileRead The program is waiting to read data while a file is being copied.
    CopyFileWrite The program is waiting to write data while a file is being copied.
    DataFileExtend The program is waiting for a relation data file to be extended.
    DataFileFlush The program is waiting for a relation data file to reach stable storage.
    DataFileImmediateSync The program is waiting for a relation data file to be immediately synchronized to reach stable storage.
    DataFilePrefetch The program is waiting for an asynchronous prefetch from a relation data file.
    DataFileRead The program is waiting to read data from a relation data file.
    DataFileSync The program is waiting for changes to a relation data file to reach stable storage.
    DataFileTruncate The program is waiting for a relation data file to be truncated.
    DataFileWrite The program is waiting to write data to a relation data file.
    DSMFillZeroWrite The program is waiting to write 0 bytes to a backup file of dynamic shared memory.
    LockFileAddToDataDirRead The program is waiting to read data while a row of data is being added to the data directory lock file.
    LockFileAddToDataDirSync The program is waiting for data to reach stable storage while a row of data is being added to the data directory lock file.
    LockFileAddToDataDirWrite The program is waiting to write data while a row of data is being added to the data directory lock file.
    LockFileCreateRead The program is waiting to read data while the data directory lock file is being created.
    LockFileCreateSync The program is waiting for data to reach stable storage while the data directory lock file is being created.
    LockFileCreateWrite The program is waiting to write data while the data directory lock file is being created.
    LockFileReCheckDataDirRead The program is waiting to read data while the data directory lock file is being rechecked.
    LogicalRewriteCheckpointSync The program is waiting for logical rewrite mappings to reach stable storage during a checkpoint.
    LogicalRewriteMappingSync The program is waiting for mapping data to reach stable storage during a logical rewrite operation.
    LogicalRewriteMappingWrite The program is waiting to write mapping data during a logical rewrite operation.
    LogicalRewriteSync The program is waiting for logical rewrite mappings to reach stable storage.
    LogicalRewriteWrite The program is waiting to write data to logical rewrite mappings.
    RelationMapRead The program is waiting to read data from the relation mapping file.
    RelationMapSync The program is waiting for the relation mapping file to reach stable storage.
    RelationMapWrite The program is waiting to write data to the relation mapping file.
    ReorderBufferRead The program is waiting to read data during reorder buffer management.
    ReorderBufferWrite The program is waiting to write data during reorder buffer management.
    ReorderLogicalMappingRead The program is waiting to read data from a logical mapping during reorder buffer management.
    ReplicationSlotRead The program is waiting to read data from the control file of a replication slot.
    ReplicationSlotRestoreSync The program is waiting for the control file of a replication slot to reach stable storage while the file is being restored to the memory.
    ReplicationSlotSync The program is waiting for the control file of a replication slot to reach stable storage.
    ReplicationSlotWrite The program is waiting to write data to the control file of a replication slot.
    SLRUFlushSync The program is waiting for Segmented Least Recently Used (SLRU) data to reach stable storage during a checkpoint or database shutdown period.
    SLRURead The program is waiting to read data from an SLRU page.
    SLRUSync The program is waiting for SLRU data to reach stable storage after a write operation is performed on a page.
    SLRUWrite The program is waiting to write data to an SLRU page.
    SnapbuildRead The program is waiting to read data from a serialized historical catalog snapshot.
    SnapbuildSync The program is waiting for a serialized historical catalog snapshot to reach stable storage.
    SnapbuildWrite The program is waiting to write data to a serialized historical catalog snapshot.
    TimelineHistoryFileSync The program is waiting for a timeline history file that is received by using streaming replication to reach stable storage.
    TimelineHistoryFileWrite The program is waiting to read data from a timeline history file that is received by using streaming replication.
    TimelineHistoryRead The program is waiting to read data from a timeline history file.
    TimelineHistorySync The program is waiting for a newly created timeline history file to reach stable storage.
    TimelineHistoryWrite The program is waiting to write data to a newly created timeline history file.
    TwophaseFileRead The program is waiting to read data from a two-phase state file.
    TwophaseFileSync The program is waiting for a two-phase state file to reach stable storage.
    TwophaseFileWrite The program is waiting to write data to a two-phase state file.
    WALBootstrapSync The program is waiting for WAL data to reach stable storage during bootstrapping.
    WALBootstrapWrite The program is waiting to write data to a WAL page during bootstrapping.
    WALCopyRead The program is waiting to read data while a WAL segment is being created by copying an existing WAL segment.
    WALCopySync The program is waiting for a WAL segment that is created by copying an existing WAL segment to reach stable storage.
    WALCopyWrite The program is waiting to write data while a WAL segment is being created by copying an existing WAL segment.
    WALInitSync The program is waiting for a newly initialized WAL file to reach stable storage.
    WALInitWrite The program is waiting to write data while a new WAL file is being initialized.
    WALRead The program is waiting to read data from a WAL file.
    WALSenderTimelineHistoryRead The program is waiting to read data from a timeline history file while the walsender timeline command is being run.
    WALSyncMethodAssign The program is waiting for data to reach stable storage while the WAL sync method is being assigned.
    WALWrite The program is waiting to write data to a WAL file.
    Note The polar_stat_activity view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
  • polar_stat_activity_rt
    Provides statuses of all processes. Data displayed in the polar_stat_activity_rt view is real-time data.
    Parameter Type Description
    pid integer The ID of the process.
    backend_type text The type of the backend process.
    cpu_user bigint The user CPU time of the backend server.
    cpu_sys bigint The system CPU time of the backend server.
    rss bigint The used memory of the backend server.
    local_read_ps bigint The cumulative sum of read operations on a local file system.
    local_write_ps bigint The cumulative sum of write operations on a local file system.
    local_read_throughput bigint The read throughput of a local file system. A cumulative sum is returned.
    local_write_throughput bigint The write throughput of a local file system. A cumulative sum is returned.
    local_read_latency_ms double The latency of the read operation on a local file system.
    local_write_latency_ms double The latency of the write operation on a local file system.
    Note The polar_stat_activity_rt view works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition. To activate this plug-in, execute the create extension polar_monitor statement.
  • polar_delta
    Notice polar_delta is a function used to query incremental values for the view. This function works together with the polar_monitor plug-in. This plug-in is built into PolarDB O Edition . To activate this plug-in, execute the create extension polar_monitor statement.
    To use the polar_delta function, follow these instructions:
    1. Create a view that contains a column for dimensions and a column for values.
      • The name of the column for dimensions must start with d.
      • The name of the column for values must start with v.
    2. Execute the following statements to query the view:
      "select * from polar_delta (NULL::view_name)"
      "\watch 1 select * from polar_delta (NULL::view_name)"
                                  
  • pg_stat_progress_vacuum
    Parameter Type Description
    pid integer The process ID of the backend.
    datid oid The OID of the database to which the backend is connected.
    datname name The name of the database to which the backend is connected.
    relid oid The OID of the table on which the index is created.
    index_relid oid The OID of the index that is created or reindexed. The value is 0 for a non-current CREATE INDEX
    command text The command that is running. Valid values: CREATE INDEX, CREATE INDEX CONCURRENTLY, REINDEX, and REINDEX CONCURRENTLY.
    phase text The current phase of the process to create indexes.
    lockers_total bigint The number of lockers for which the backend needs to wait when this parameter is applicable.
    lockers_done bigint The number of lockers for which the backend is waited.
    current_locker_pid bigint The process ID of the locker for which the backend is waiting.
    blocks_total bigint The number of blocks to be processed in the current phase.
    blocks_done bigint The number of blocks that have been processed in the current phase.
    tuples_total bigint The number of tuples to be processed in the current phase.
    tuples_done bigint The number of tuples that have been processed in the current phase.
    partitions_total bigint When you create an index on a partitioned table, the value indicates the number of partitions on which the index is to be created.
    partitions_done bigint When you create an index on a partitioned table, the value indicates the number of partitions that are indexed.
  • pg_stat_bgwriter
    The pg_stat_bgwriter view provides a single row that contains the global data of the cluster.
    Parameter Type Description
    checkpoints_timed bigint The number of checkpoints that have been performed.
    checkpoints_req bigint The number of requested checkpoints that have been performed.
    checkpoint_write_time double precision The total amount of time spent on checking the file during the checkpoints in which the file was written to disks. Unit: milliseconds.
    checkpoint_sync_time double precision The total amount of time spent on checking the file during the checkpoints in which the files were synchronized to disks. Unit: milliseconds.
    buffers_checkpoint bigint The number of buffers that are written during checkpoints.
    buffers_clean bigint The number of buffers that are occupied by the background writer process.
    maxwritten_clean bigint The number of times that the background writer process stopped a cleaning scan because it had written a large number of buffers.
    buffers_backend bigint The number of buffers that are directly written by a backend.
    buffers_backend_fsync bigint The number of times that a backend had executed the fsync call instead of a background write operation. In most cases, the background writer process handles write operations even when the backend also performs the write operations.
    buffers_alloc bigint The number of assigned buffers.
    stats_reset timestamp with time zone The last time at which the statistics were reset.
  • pg_locks
    Parameter Type Description
    locktype text The type of the lockable object. Valid values: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, and advisory.
    database oid The OID of the database in which the object to be locked exists. If the object is a shared object, the value is 0. If the object is an XID, the value is null.
    relation oid The OID of the relation. If the object to be locked is not a relation or is only part of a relation, the value is null.
    page integer The number of the page to be locked within the relation. If the object to be locked is not a tuple or a relation page, the value is null.
    tuple smallint The tuple number of the tuple to be locked within the page. If the object to be locked is not a tuple, the value is null.
    virtualxid text The virtual ID of the transaction to be locked. If the object to be locked is not a virtual XID, the value is null.
    transactionid xid The ID of the transaction to be locked. If the object to be locked is not an XID, the value is null.
    classid oid The OID of the system catalog that contains the object to be locked. If the object is not a general database object, the value is null.
    objid oid The OID of the object to be locked within the system catalog. If the object is not a general database object, the value is null.
    objsubid smallint The ID of the column to be locked. The values in classid and objid refer to the table itself. If the object to be locked is another general database object, the value is 0. If the object is not a general database object, the value is null.
    virtualtransaction text The virtual ID of the transaction that holds the lock or is waiting for the lock.
    pid integer The ID of the server process that holds the lock or is waiting for the lock. If this lock is held by the prepared transaction, the value is null.
    mode text The name of the lock mode that is held or desired by this process.
    granted boolean If the lock is held, the value is true. If the lock is waited for, the value is false.
    fastpath boolean If the lock is obtained by using a fast path, the value is true. If the lock is obtained from the main lock table, the value is false.