All Products
Search
Document Center

PolarDB:Commit timestamp (CTS) technology

Last Updated:Mar 28, 2026

In high-concurrency online transaction processing (OLTP) workloads, MySQL's active transaction list becomes a bottleneck: every transaction start, commit, and visibility check must acquire the trx sys mutex, limiting throughput and preventing full use of multiple vCPUs. PolarDB for MySQL addresses this with PolarTrans, which replaces the active transaction list with Commit Timestamp Store (CTS) — an in-memory, lock-free mechanism that tracks transaction state using commit timestamps instead of mutex-protected arrays.

This topic explains how CTS works, what it improves at each stage of the transaction lifecycle, and how performance changes after PolarTrans is enabled.

Supported versions

To enable PolarTrans through the global consistency (high-performance mode) feature, your PolarDB for MySQL Enterprise Edition cluster must meet one of the following version requirements:

  • Engine version 8.0.2 with a revision version of 8.0.2.2.19 or later

  • Engine version 8.0.1 with a revision version of 8.0.1.1.29 or later

  • Engine version 5.7 with a revision version of 5.7.1.0.26 or later

To check your cluster version, see the "Query the engine version" section of Engine versions.

Why active transaction lists limit performance

Mainstream relational databases such as MySQL and PostgreSQL implement Multi-Version Concurrency Control (MVCC) using an active transaction list. In high-concurrency environments, this approach creates three problems:

  • Cannot fully use multiple vCPUs to process concurrent transactions

  • Creates performance bottlenecks when many transactions compete for the trx sys mutex

  • Does not adequately support read consistency, multi-point writes, and Extended Architecture (XA) transaction management in shared-nothing architectures

PolarTrans addresses these limitations by replacing the active transaction list with CTS. Instead of copying transaction state, PolarTrans determines transaction visibility based on the maximum commit timestamp of the cluster. CTS logs are maintained entirely in memory: each transaction is modulo-mapped to a specific slot in a ring buffer based on its trx_id, and each slot holds a trx pointer and a commit sequence number (CSN).

How CTS improves each transaction stage

The active transaction list requires acquiring a trx sys mutex at three critical points in the transaction lifecycle. CTS eliminates this requirement at all three stages.

StageTraditional approachPolarTrans (CTS)
Transaction startAllocates a transaction ID, adds it to rw_trx_ids, updates rw_trx_set and rw_trx_list — all under trx sys mutexRecords transaction info in the CTS log, modulo-allocates a slot based on trx_id, marks the slot with an active tag — lock-free
Transaction commitQueries rw_trx_ids, removes the transaction ID, updates rw_trx_set and rw_trx_list — under trx sys mutexAssigns a commit timestamp and updates the CSN field in the CTS log only
Visibility determinationCopies the active transaction ID array, records the minimum and maximum transaction ID, queries the array to determine row visibility — under trx sys mutexCompares the CSN of the read-only transaction with the trx csn field in the row record, using the system's maximum commit timestamp instead of a read view

PolarTrans implements lock-free algorithms across most transaction logic to improve throughput in both read-write and write-only scenarios.

Performance comparison

The following test measures queries per second (QPS) before and after enabling PolarTrans.

Test environment:

ParameterValue
ClusterPolarDB for MySQL 8.0, Cluster Edition
Specs88 cores, 710 GB memory
Test toolSysbench
Data volume88 tables, 12 million rows per table

Test cases:

Results: PolarTrans significantly improves QPS in read-write and write-only scenarios.

In read-only scenarios, PolarTrans does not improve performance. Read-only transactions already benefit from read view caching, which reduces the locking overhead from copying transaction state.

Enable PolarTrans

PolarTrans is enabled by default when you enable the global consistency (high-performance mode) feature. For setup instructions, see the "Enable global consistency (high-performance mode)" section of the Overview topic.