tencent cloud

TDSQL Boundless

Release Notes
Product Introduction
Overview
Scenarios
Product Architecture
Instance Types
Compatibility Notes
Kernel Features
Kernel Overview
Kernel Version Release Notes
Functionality Features
Performance Features
Billing
Billing Overview
Purchase Method
Pricing Details
Renewal
Overdue Payments
Refund
Getting Started
Creating an Instance
Connect to Instances
User Guide
Data Migration
Data Subscription
Instance Management
Configuration Change
Parameter Configuration
Account Management
Security Group
Backup and Restoration
Database Auditing
Tag Management
Use Cases
Technical Evolution and Usage Practices of Online DDL
Lock Mechanism Analysis and Troubleshooting Practices
Data Intelligent Scheduling and Related Practices for Performance Optimization
TDSQL Boundless Selection Guide and Practical Tutorial
Developer Guide
Developer Guide (MySQL Compatibility Mode)
Developer Guide (HBase Compatibility Mode)
Performance Tuning
Performance Tuning Overview
SQL Tuning
DDL Tuning
Performance White Paper
Performance Overview
TPC-C Test
Sysbench Test
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Security Group APIs
Task APIs
Backup APIs
Rollback APIs
Parameter APIs
Database APIs
Data Types
Error Codes
General Reference
System Architecture
SQL Reference
Database Parameter Description
TPC-H benchmark data model reference
Error Code Information
Security and Compliance
FAQs
Agreements
Service Level Agreement
Terms of Service
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

DATA_LOCK_WAITS

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-02-10 11:06:28

Feature

PERFORMANCE_SCHEMA.DATA_LOCK_WAITS is used to display all information about pessimistic lock waiting on the TDStore of all hybrid nodes in the cluster.
When users do not query the DATA_LOCK_WAITS table, DATA_LOCK_WAITS will not incur additional overhead. Users do not need to set the performance_schema system variable to ON to query the DATA_LOCK_WAITS table.

Field Description

Field Name
Type
Description
ENGINE
varchar(32)
Storage engine. For TDStore, the value is RocksDB.
REQUESTING_ENGINE_LOCK_ID
varchar(128)
Indicates the pessimistic lock that is being applied for by the locked transaction uniquely identified as being blocked or the key range that is being read. For TDStore, its format is <ID of the transaction holding the lock>_<lock scope>. The format of <lock scope> is:
If the lock scope is a single key, <lock scope> is the hexadecimal representation of the key. For example: The lock identifier 28673778183569468_00002797 indicates that a transaction with ID 28673778183569468 has added a pessimistic lock to the key with hexadecimal code 00002797.
If the lock scope is a key interval, the format of <lock scope> is [<hex_start_key>,<hex_end_key>) (left-closed and right-open) or (<hex_start_key>,<hex_end_key>) (open interval). For example: The lock identifier 28673778183569468_[00002797,00002798) indicates that the transaction with ID 28673778183569468 has added a pessimistic lock to the interval [00002797,00002798).
When the hexadecimal representation of a key is too long and cannot be fully represented within 128 characters, the last two characters of the field value will be set to .., indicating that this is not a complete lock identifier. In such cases, when users query information about pessimistic locks via ENGINE_LOCK_ID, they must also use the field value containing .. to perform the query.
REQUESTING_NODE_ID
bigint unsigned
Enabling the ID of the SQLEngine node of the blocked transaction.
REQUESTING_NODE_NAME
varchar(64)
Enabling the name of the SQLEngine node of the blocked transaction.
REQUESTING_ENGINE_TRANSACTION_ID
bigint unsigned
The unique identifier of the blocked transaction. For TDStore, if the blocked request is read-only, the value is 0.
REQUESTING_THREAD_ID
bigint unsigned
The thread ID executing the blocked transaction. This is the thread ID internally maintained by Performance Schema, which can be used to correlate with various Performance Schema event tables.
REQUESTING_EVENT_ID
bigint unsigned
Indicates the event ID of the Performance Schema causing the lock acquisition by the blocked transaction. For TDStore, the value is NULL.
REQUESTING_OBJECT_INSTANCE_BEGIN
bigint unsigned
Indicates the address of the lock request in memory.
BLOCKING_ENGINE_LOCK_ID
varchar(128)
The unique identifier of the pessimistic lock. For TDStore, the format refers to the ENGINE_LOCK_ID field in the data_locks table.
BLOCKING_NODE_ID
bigint unsigned
Enabling the ID of the SQLEngine node of the transaction holding the pessimistic lock.
BLOCKING_NODE_NAME
varchar(64)
Displaying the name of the SQLEngine node of the transaction holding the pessimistic lock.
BLOCKING_ENGINE_TRANSACTION_ID
bigint unsigned
Indicates the unique identifier of the transaction holding the pessimistic lock. If the pessimistic lock is a read lock held by multiple transactions, only the unique identifier of one transaction will be displayed.
BLOCKING_THREAD_ID
bigint unsigned
The thread ID executing the transaction holding the pessimistic lock. This is the thread ID internally maintained by Performance Schema, which can be used to correlate with various event tables of Performance Schema.
BLOCKING_EVENT_ID
bigint unsigned
Indicates the ID of the Performance Schema event that caused the transaction holding the pessimistic lock to be locked. For TDStore, the value is NULL.
BLOCKING_OBJECT_INSTANCE_BEGIN
bigint unsigned
Indicates the address of the pessimistic lock in memory.
TINDEX_ID
int unsigned
Indicates the tindex ID corresponding to the pessimistic lock. By using the value of this field, you can execute SELECT * FROM information_schema.statistics WHERE tindex_id=... to retrieve table information associated with the tindex ID from the system tables.
DATA_SPACE_TYPE
varchar(32)
Indicates data space corresponding to the pessimistic lock. DATA_SPACE_TYPE_USER represents locking part of the data in user tables. DATA_SPACE_TYPE_SYSTEM represents locking part of the data in system tables.
REPLICATION_GROUP_ID
bigint unsigned
Indicates the replication group ID corresponding to the pessimistic lock.
KEY_RANGE_REGION_ID
bigint unsigned
Indicates the region ID of the key range corresponding to the pessimistic lock.

Examples

Output example:
tdsql [(none)]> SELECT * FROM performance_schema.data_lock_waits \\G
*************************** 1. row ***************************
ENGINE: RocksDB
REQUESTING_ENGINE_LOCK_ID: 28681541555060779_[00002797,00002798)
REQUESTING_NODE_ID: 2
REQUESTING_NODE_NAME: node-1-002
REQUESTING_ENGINE_TRANSACTION_ID: 28681541555060779
REQUESTING_THREAD_ID: 44
REQUESTING_EVENT_ID: 0
REQUESTING_OBJECT_INSTANCE_BEGIN: 139759771095568
BLOCKING_ENGINE_LOCK_ID: 28681535313936395_0000279780000001
BLOCKING_NODE_ID: 1
BLOCKING_NODE_NAME: node-1-001
BLOCKING_ENGINE_TRANSACTION_ID: 28681535313936395
BLOCKING_THREAD_ID: 44
BLOCKING_EVENT_ID: 0
BLOCKING_OBJECT_INSTANCE_BEGIN: 139759768476120
TINDEX_ID: 10135
DATA_SPACE_TYPE: DATA_SPACE_TYPE_USER
REPLICATION_GROUP_ID: 257
KEY_RANGE_REGION_ID: 7312
Query Example:
-- Query the number of requests waiting for pessimistic locks on all nodes.
SELECT COUNT(*) FROM performance_schema.data_lock_wais \\G

-- Query all information on waiting for pessimistic locks for key range region 7312 in replication group 257 across all nodes (Querying by key_range_region_id alone is possible but less efficient, as it cannot leverage index acceleration).
SELECT * FROM performance_schema.data_lock_waits WHERE replication_group_id = 257 AND key_range_region_id = 7312 \\G

-- Query information about the pessimistic lock that transaction 28682479434989637 is waiting for on all nodes.
SELECT blocking_engine_lock_id FROM performance_schema.data_lock_waits WHERE requesting_engine_transaction_id = 28682479434989637;
-- Specify engine_lock_id as the value of the blocking_engine_lock_id field obtained from the first sql query.
SELECT * FROM performance_schema.data_locks WHERE engine_lock_id = '29417475275751454_00002C7B80000003';

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan