How TiDB Handles Performance Issues Caused by Data Skew

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB如何处理数据倾斜引起的性能问题

| username: alfred

【TiDB Usage Environment】Production\Test Environment\POC
【TiDB Version】
【Encountered Issues】
【Reproduction Path】What operations were performed to cause the issue
【Issue Phenomenon and Impact】
【Attachments】

  • Relevant logs, configuration files, Grafana monitoring (https://metricstool.pingcap.com/)
  • TiUP Cluster Display information
  • TiUP Cluster Edit config information
  • TiDB-Overview monitoring
  • Corresponding module’s Grafana monitoring (if any, such as BR, TiDB-binlog, TiCDC, etc.)
  • Corresponding module logs (including logs from 1 hour before and after the issue)

If the question is related to performance optimization or troubleshooting, please download the script and run it. Please select all the terminal output and copy-paste it for upload.

| username: TiDBer_jYQINSnf | Original post link

Is it a hotspot issue?

Or is the data distribution uneven?
If the distribution is uneven, you can check the labels, such as the rack. If two TiKVs are on the same rack, then these two cannot have two replicas of one region, which will lead to uneven data distribution on TiKV.

| username: 数据小黑 | Original post link

Here are a few additional documents for reference:

| username: Meditator | Original post link

Is it capacity skew or request skew? The former is related to label and TiKV weight design, while the latter is a hotspot issue.

| username: alfred | Original post link

Data skew and data imbalance.

| username: h5n1 | Original post link

TiDB has histograms, TopN, and other statistical information to choose the best execution plan possible.

| username: alfred | Original post link

In general, histograms tend to have more bugs. How is the actual usage?

| username: h5n1 | Original post link

The vast majority of execution plans are still relatively good. Even Oracle cannot solve the histogram problem 100%.

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.