Is there a limit on table size when adding an index in TiDB?

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

Original topic: tidb新增索引对表大小有限制吗

| username: 小于同学

How long does it take to add an index to 18 million records?

| username: TiDBer_vJGTQABF | Original post link

The image you uploaded cannot be processed for translation. Please provide the text content directly for translation.

| username: tidb菜鸟一只 | Original post link

It depends on the version. After version 6, the speed of adding indexes has increased significantly.

| username: TiDBer_QYr0vohO | Original post link

It should be soon.

| username: TIDB-Learner | Original post link

As fast as a whoosh.

| username: TiDBer_H5NdJb5Q | Original post link

Mark, learn it.

| username: kelvin | Original post link

Just add it directly, and it will be done in a flash.

| username: 友利奈绪 | Original post link

Useful share

| username: shigp_TIDBER | Original post link

Which version? If it’s 6.5 or above, it will be very fast.

| username: hacker_77powerful | Original post link

TiDB supports online DDL, adding indexes does not affect the business.

| username: zhh_912 | Original post link

It depends on the version. Higher versions do not have explicit limitations.

| username: zhaokede | Original post link

A single-field index takes about 2 minutes, but the time may vary depending on the performance of each server.

| username: yytest | Original post link

It should be soon, haven’t tested it.

| username: 呢莫不爱吃鱼 | Original post link

That must have been completed very quickly.

| username: 不想干活 | Original post link

The new version is very fast.

| username: lemonade010 | Original post link

Tested on TIDB 6.5.3, the speed is very fast, around 2 to 3 minutes.

| username: TiDBer_RjzUpGDL | Original post link

Directly add

| username: 鱼跃龙门 | Original post link

The new version is very fast, estimated to take three to four minutes.

| username: 濱崎悟空 | Original post link

It depends on the situation, it could be a few minutes.

| username: zhanggame1 | Original post link

Based on the machine’s performance, I estimate a few minutes.