数据仓库服务 GAUSSDB(DWS)-PGXC_LWLOCKS:示例

时间:2024-12-09 15:13:24

示例

使用PGXC_LWLOCKS视图查询当前集群中所有实例正在持有的或等待的轻量级锁信息:
1
2
3
4
5
6
7
8
SELECT * FROM pgxc_lwlocks;
 nodename  |       pid       |     query_id      | lwtid | reqlockid | reqlock | heldlocknums | heldlockid |      heldlock      | heldlockmode
-----------+-----------------+-------------------+-------+-----------+---------+--------------+------------+--------------------+--------------
 datanode1 | 139810224193360 | 78250043525924188 | 54844 |           |         |            1 |      76390 | BUFFER_POOL_LWLOCK | Shared
 datanode1 | 139810224198200 | 78250043525924886 | 54922 |           |         |            1 |     957438 | PGPROC_LWLOCK      | Exclusive
 datanode2 | 140262654050288 |                 0 | 54832 |           |         |            1 |          7 | WALWriteLock       | Exclusive
 datanode2 | 140262654052488 | 78250043525923195 | 54847 |           |         |            1 |      15862 | BUFFER_POOL_LWLOCK | Shared
(4 rows)
support.huaweicloud.com/devg-910-dws/dws_04_1412.html