Skip to content

Support data affinity schedule for performance optimization #9764

@lhy1024

Description

@lhy1024

Development Task

Background

As a distributed database, TiDB inherently incurs network overhead that is not present in single-node databases. For many workloads, data from the same table or partition is frequently accessed together. The distribution of this data across different TiKV nodes can lead to significant cross-node communication for query execution, increasing latency and consuming more resources.

In our real-world load testing, we have observed that by ensuring data and indexes for the same table or partition are consolidated within a single Region, we can achieve substantial performance gains. Specifically, this co-location leads to higher QPS, lower query latency, and a notable reduction in CPU and network I/O resource consumption.

This feature will unlock key optimization opportunities, such as:

  • More Read and Write Push Down
  • More 1PC txn requests

Demo Test Result

Metric index lookup pushdown data affinity 1PC Both
read queries +7.59% +7.12% +18.41%
write queries +7.59% +7.12% +18.41%
avg latency (ms) -7.05% -6.64% -15.54%
95th percentile (ms) -5.26% -5.26% -14.96%

Image

Image

Phase I plan

Release 8.5.5

We don't put MCS in 8.5.5 and disable the affinity schedule by default.

Metadata

Metadata

Assignees

Labels

affects-8.5This bug affects the 8.5.x(LTS) versions.type/developmentThe issue belongs to a development tasks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions