pingcap / pingcap/tidb

Top SQL is not reporting correctly in the Sysbench PointSelect workload

Open
#33,499 0 comments 0 reactions 1 assignee Claimed by @crazycs520 View on GitHub
affects-6.0 severity/moderate sig/diagnosis type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

```shell
sysbench oltp_point_select prepare --mysql-host=127.0.0.1 --mysql-port=4000 --mysql-user=root --db-driver=mysql --mysql-db=test --threads=400 --time=600 --report-interval=10
sysbench oltp_point_select run --mysql-host=127.0.0.1 --mysql-port=4000 --mysql-user=root --db-driver=mysql --mysql-db=test --threads=400 --time=300 --report-interval=10
```

### 2. What did you expect to see? (Required)

Top SQL shows exactly the same Top N sql statements for each run.

### 3. What did you see instead (Required)

The **Second** Top sql statements changes each time when the cluster is re-deployed. It even shows that `CREATE TABLE` statement is taking a lot of CPU, which is definitely incorrect.

![wWwcCrB6lI](https://user-images.githubusercontent.com/1916485/160341460-9d1138bf-0d26-406d-9769-153bf6222d4d.png)
![qDKTIys9DR](https://user-images.githubusercontent.com/1916485/160341468-31653176-c639-4634-bc10-442a2b25201d.png)
![oxhhaO8tvl](https://user-images.githubusercontent.com/1916485/160341478-1fc916fa-4edd-4dd5-b446-0c5daeee1c4a.png)
![origin_img_v2_cde2911b-b79b-4a0c-b57f-df95cc1b63cg](https://user-images.githubusercontent.com/1916485/160341489-576f7026-4ac4-4524-9fa9-9feaa963edc7.png)

### 4. What is your TiDB version? (Required)

master.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.