tidb_plan_cache_invalidation_on_fresh_stats causing unstable tpc-c performance
- 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.


```
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
Assessment
This issue has not been assessed yet.