What is the maximum number of columns for wide tables in TiDB and TiFlash without affecting SQL performance?

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

Original topic: tidb和tiflash 大宽表字段最多可以到多少?(不影响SQL性能前提)

| username: qiuxb

[TiDB Usage Environment] Production Environment / Testing / PoC
Production Environment
[TiDB Version]
v4.0.8
[Encountered Problem]
The business uses a wide table, which is a partitioned table type, with 4 million records per day, containing data from the past year.

The number of fields has reached 100 and is still growing. Currently, the number of fields will continue to increase.

I would like to ask for everyone’s suggestions.

[Reproduction Path] What operations were performed to encounter the problem
[Problem Phenomenon and Impact]

[Attachments]

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: buddyyuan | Original post link

You can calculate it, a single row should preferably not exceed 6MB.

You can refer to this document:

| username: TiDBer_jYQINSnf | Original post link

The data in TiFlash all comes from TiKV and cannot be stored separately, so the limitation is the default limitation of the TiDB cluster, which is 512 and cannot be adjusted. In higher versions, such as 6.1, it can be adjusted to a maximum of 4096.