Updated on 2023-10-31 GMT+08:00

PGXC_LOCKWAIT_DETAIL

PGXC_LOCKWAIT_DETAIL displays detailed information about the lock wait hierarchy on each node in a cluster. If a node has multiple lock wait levels, the entire lock waiting hierarchy is displayed in sequence.

This view is supported only by clusters of version 8.1.3.200 or later.

Table 1 PGXC_LOCKWAIT_DETAIL columns

Name

Type

Description

level

integer

Level in the lock wait hierarchy. The value starts with 1 and increases by 1 when there is a wait relationship.

node_name

name

Node name, corresponding to the node_name column in the pgxc_node table.

lock_wait_hierarchy

text

Lock wait hierarchy , in the format of Node name: Process ID->Waiting process ID->Waiting process ID->...

lock_type

text

Type of the locked object

database

oid

OID of the database where the locked target is

relation

oid

OID of the locked object relationship

page

integer

Page index in a relationship

tuple

smallint

Row number of a page.

virtual_xid

text

Virtual ID of a transaction

transaction_id

xid

Transaction ID

class_id

oid

OID of the system catalog that contains the object

obj_id

oid

OID of the object in its system catalog

obj_subid

smallint

Column number of a table

virtual_transaction

text

Virtual ID of the transaction holding or awaiting this lock

pid

bigint

ID of the thread holding or awaiting this lock

mode

text

Lock level

granted

boolean

Indicates whether a lock is held.

fastpath

boolean

Indicates whether to obtain a lock using FASTPATH.

wait_for_pid

bigint

ID of the thread where a lock conflict occurs.

conflict_mode

text

Level of the conflicted lock held by the thread where it is

query_id

bigint

ID of a query statement.

query

text

Query statement

application_name

text

Name of the application connected to the backend

backend_start

timestamp with time zone

Startup time of the backend process, that is, the time when the client connects to the server

xact_start

timestamp with time zone

Start time of the current transaction

query_start

timestamp with time zone

Start time of the active query

state

text

Overall state of the backend

Examples

  1. Connect to the DN, start a transaction, and run the following command:

  2. Connect to the CN in another window and truncate table t1.

    In this case, truncation is blocked.

  3. Open another window to connect to the CN and run the select * from pgxc_lockwait_detail; command.