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

Isolation Level

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-03-06 18:48:24

Overview

Database transaction isolation levels are mechanisms that control the degree of interaction between concurrent transactions. The core objective is to balance concurrency performance while ensuring data consistency. The SQL standard defines four isolation levels, each addressing different data anomalies.

Description of Data Anomaly Types

Dirty read: A transaction reads data modified by another uncommitted transaction.
Non-repeatable read: Within the same transaction, reading the same data multiple times yields inconsistent results (the data has been modified by other committed transactions).
Phantom read: Within the same transaction, multiple queries with identical conditions return inconsistent result sets (due to other committed transactions inserting or deleting data).

Isolation Level Comparison Table

Isolation Level
Dirty Read
Non-Repeatable Read
Phantom Read
Scenarios
Read uncommitted (Read Uncommitted)
Possible
Possible
Possible
Generally not recommended for use.
Read committed (Read Committed)
Impossible
Possible
Possible
Read/write separation, high real-time requirements
Repeatable Read (Repeatable Read)
Impossible
Impossible
Possible (but MySQL InnoDB and TDSQL Boundless have largely resolved it)
default level, complex business logic
Serializable (Serializable)
Impossible
Impossible
Impossible
Strong consistency requirement

Analysis of Isolation Levels Behavior for TDSQL Boundless

TDSQL Boundless supports only Read Committed (Read Committed) and Repeatable Read (Repeatable Read) isolation levels. The default isolation level is Repeatable Read.

Repeatable Read Level

TDSQL Boundless fully supports the Repeatable Read isolation level, with behavior highly similar to MySQL. More precisely, TDSQL Boundless supports the snapshot isolation level, which does not exhibit phantom read exceptions but may still encounter write skew exceptions.
Snapshot obtaining method: When a transaction reads for the first time, it creates a consistent view (snapshot). Subsequent read operations will be based on this snapshot, thereby ensuring that the data read within this transaction is consistent.

Read Committed Level

TDSQL Boundless also supports the Read Committed level, but its implementation differs significantly from MySQL's.
Snapshot Acquisition Method: At this level, TDSQL Boundless reacquires the latest committed data snapshot for each query statement. That is, read operations within a single statement occur under the same snapshot, but read operations across multiple statements occur under different snapshots.
Key Differences in Locking Behavior: In TDSQL Boundless, certain pessimistic locking behaviors at the Read Committed level resemble those at the Repeatable Read level, differing from MySQL's implementation of Read Committed.
In MySQL's Read Committed level: For current reads such as SELECT ... FOR UPDATE, it generally only locks existing records matching the query and does not apply gap locks (Gap Lock), to reduce lock conflicts.
Under TDSQL Boundless's Read Committed level: To ensure strict consistency in distributed environments, it still employs range locks. This means that even at the Read Committed level, a transaction performing range queries with locks may still prevent other transactions from inserting data into that range, a behavior similar to its Repeatable Read level.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백