Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index creation in TiDB 5.0 is much slower than 4.0. #1730

Closed
LittleFall opened this issue Apr 7, 2021 · 5 comments
Closed

Index creation in TiDB 5.0 is much slower than 4.0. #1730

LittleFall opened this issue Apr 7, 2021 · 5 comments

Comments

@LittleFall
Copy link
Contributor

LittleFall commented Apr 7, 2021

The schrodinger/sqllogic test is about 4 times slower than 4.0 on 5.0.

https://internal.pingcap.net/idc-jenkins/blue/organizations/jenkins/tiflash_schrodinger_test/activity/

https://pingcap.slack.com/archives/CQ3EL6Q95/p1616368188001100

I tested in idc81, for the same sqllogic binary, the 4.0 cluster is many times faster than the 5.0 cluster, no matter mpp is enabled.

@LittleFall
Copy link
Contributor Author

LittleFall commented Apr 12, 2021

I tested in idc81 with the modified test binary:

  1. without create index or create unique index statement: commit https://github.com/LittleFall/schrodinger-test/commit/971ef6c94881f847468e6dc995f73df46b642f87

There is little difference between 4.0 and 5.0 qps, both several hundred(with fluctuation over time)

noindex4.log
noindex5.log

  1. without tiflash replica, without query, only ddl and insert statement: commit https://github.com/LittleFall/schrodinger-test/commit/c2c423d9a1027641a43a2c22d424da3eef0f499f

4.0 qps 100+
5.0 qps 2

noflash-onlyindex4.log
noflash-onlyindex5.log

@LittleFall LittleFall changed the title The schrodinger/sqllogic test is about 4 times slower than 4.0 on 5.0. Index creation in TiDB 5.0 is much slower than 4.0. Apr 12, 2021
@LittleFall
Copy link
Contributor Author

A minimal and generally reproduce

tiup playground v5.0.0 --tiflash 0

mysql> create table t(a int);
Query OK, 0 rows affected (0.12 sec)

mysql> create index i on t(a);
Query OK, 0 rows affected (2.83 sec)

tiup playground v4.0.12 --tiflash 0

mysql> create table t(a int);
Query OK, 0 rows affected (0.08 sec)

mysql> create index i on t(a);
Query OK, 0 rows affected (0.36 sec)

@AilinKid
Copy link
Contributor

grep sleep before DDL finishes to make async commit and 1PC safe tidb.log

@LittleFall
Copy link
Contributor Author

LittleFall commented Apr 12, 2021

sleep added in pingcap/tidb#23364

@zimulala
Copy link

zimulala commented Apr 12, 2021

I think we can explain roughly in the document, at what-is-the-processing-time-of-a-ddl-operation. Related to pingcap/docs-cn#6020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants