pingcap / pingcap/tidb

paging copr cannot hit copr cache

Open
#49,232 2 comments 0 reactions 1 assignee Claimed by @tiancaiamao View on GitHub
affects-6.1 affects-6.5 affects-7.1 affects-7.5 affects-8.1 affects-8.5 severity/major sig/sql-infra 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)
1. load tpcc 1000 warehouse(tiup br:v7.1.0 restore db --db=tpcc --pd 127.0.0.1:13425 --storage s3://benchmark/ch-1k-v5 --s3.endpoint http://minio.pingcap.net:9000 --send-credentials-to-tikv=true --check-requirements=false)
2. enable paging and run sql multiple times:
```
set @@tidb_enable_paging=on;
explain analyze select /*+ use_index(orders,idx_order) */ * from orders where o_w_id > 1 and o_d_id > 1 and o_c_id > 10 limit 10000;
```
3. disable paging and run sql multiple times:
```
set @@tidb_enable_paging=on;
explain analyze select /*+ use_index(orders,idx_order) */ * from orders where o_w_id > 1 and o_d_id > 1 and o_c_id > 10 limit 10000;
```

### 2. What did you expect to see? (Required)
copr cache always hit
### 3. What did you see instead (Required)
copr cache not hit when paging is enabled:
![img_v3_025s_895b58b4-df9e-4afe-89f5-129513ee21fg](https://github.com/pingcap/tidb/assets/7493273/1f045b14-1f0e-4d5b-98a6-92f83481b15c)

and copr cache is hit when paging is disabled:
![img_v3_025s_c9102385-1a41-485a-8d21-bc6bed70cb3g](https://github.com/pingcap/tidb/assets/7493273/9be8f982-63f6-400f-a6ec-e96172473905)

### 4. What is your TiDB version? (Required)
```
MySQL [tpcc]> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.6.0-alpha-194-g0f978e9
Edition: Community
Git Commit Hash: 0f978e9849fb122077f9f7a57ea25142bd4f4107
Git Branch: debug_coprcache
UTC Build Time: 2023-12-06 13:06:44
GoVersion: go1.21.3
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.038 sec)
```

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.