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

PGXC_WAIT_DETAIL

PGXC_WAIT_DETAIL displays detailed information about the SQL waiting hierarchy of all nodes in a cluster. This view is supported only by clusters of version 8.1.3.200 or later.

Table 1 PGXC_WAIT_DETAIL columns

Name

Type

Description

level

integer

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

lock_wait_hierarchy

text

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

node_name

text

Node name

db_name

text

Database name

thread_name

text

Thread name

query_id

bigint

ID of a query statement

tid

bigint

Thread ID of the current thread

lwtid

integer

Lightweight thread ID of the current thread

ptid

integer

Parent thread of the streaming thread

tlevel

integer

Level of the streaming thread

smpid

integer

Concurrent thread ID

wait_status

text

Waiting status of the current thread

wait_event

text

Virtual ID of the transaction holding or awaiting this lock

exec_cn

boolean

SQL execution CN

wait_node

text

Lock level

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

waiting

boolean

Waiting status

state

text

Overall state of the backend

Examples

  1. Connect to the CN, start a transaction, and perform the update operation.

  2. Open another window to connect to the CN, start another transaction, and perform the update operation. (Do not update the same record concurrently.)

    In this case, the update operation is blocked.

  3. Open another window to connect to the CN node and create an index.

  4. Run the select * from pgxc_wait_detail; command.