pingcap / pingcap/tidb

tidb_plan_cache_invalidation_on_fresh_stats causing unstable tpc-c performance

Open
#43,928 0 comments 0 reactions 1 assignee Claimed by @qw4990 View on GitHub
affects-7.5 may-affects-5.1 may-affects-5.2 may-affects-5.3 may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/moderate sig/planner 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)

run tpc-c 1k warehouse workload
```
go-tpc tpcc --host lb.release-perftest-amd64-tpcc-stability-7d-tps-1740648-1-909 -P4000 --warehouses 1000 run -D tpcc -T 200 --time 168h0m0s --ignore-error
```

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

### 3. What did you see instead (Required)
unstable tpc-c performance and there are 306 plans for below query.
![image](https://github.com/pingcap/tidb/assets/2316425/973528ca-b6a5-419d-b6a0-3dbcdea7599f)

![image](https://github.com/pingcap/tidb/assets/2316425/e7ced51e-e482-4ac9-9784-2c8245e06258)

```
SELECT
count (DISTINCT (`s_i_id`)) `stock_count`
FROM
`order_line`,
`stock`
WHERE
`ol_w_id` = ?
AND `ol_d_id` = ?
AND `ol_o_id` < ?
AND `ol_o_id` >= ? - ?
AND `s_w_id` = ?
AND `s_i_id` = `ol_i_id`
AND `s_quantity` < ?
```
### 4. What is your TiDB version? (Required)

```
Release Version: v7.2.0-alpha
Edition: Community
Git Commit Hash: 6dd84b6fef5482b0d9d5e2a9c66241e89b824369
Git Branch: heads/refs/tags/v7.2.0-alpha
UTC Build Time: 2023-05-17 02:44:24
GoVersion: go1.20.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv |
```

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.