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

scan details of store-batched copr are not correctly handled #41582

Open
you06 opened this issue Feb 20, 2023 · 0 comments
Open

scan details of store-batched copr are not correctly handled #41582

you06 opened this issue Feb 20, 2023 · 0 comments
Labels

Comments

@you06
Copy link
Contributor

you06 commented Feb 20, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Prepare with this script.

Run the query with batch

set session tidb_store_batch_size = 4;
explain analyze select * from t force index(i) where c1 = "yes";

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

MySQL [test]> set session tidb_store_batch_size = 4;
Query OK, 0 rows affected (0.001 sec)

MySQL [test]> explain analyze select * from t force index(i) where c1 = "yes";
+-------------------------------+---------+---------+-----------+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+---------+------+
| id                            | estRows | actRows | task      | access object        | execution info                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | operator info                         | memory  | disk |
+-------------------------------+---------+---------+-----------+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+---------+------+
| IndexLookUp_7                 | 911.94  | 1000    | root      |                      | time:34.4ms, loops:2, index_task: {total_time: 3.44ms, fetch_handle: 3.43ms, build: 5.24µs, wait: 6.71µs}, table_task: {total_time: 30.6ms, num: 1, concurrency: 5}                                                                                                                                                                                                                                                                                                                                                          |                                       | 52.6 KB | N/A  |
| ├─IndexRangeScan_5(Build)     | 911.94  | 1000    | cop[tikv] | table:t, index:i(c1) | time:3.36ms, loops:3, cop_task: {num: 3, max: 1.25ms, min: 868.2µs, avg: 1.07ms, p95: 1.25ms, max_proc_keys: 480, p95_proc_keys: 480, rpc_num: 3, rpc_time: 3.12ms, copr_cache: disabled, distsql_concurrency: 15}, tikv_task:{proc max:1ms, min:0s, avg: 333.3µs, p80:1ms, p95:1ms, iters:11, tasks:3}, scan_detail: {total_process_keys: 1000, total_process_keys_size: 58000, total_keys: 1003, get_snapshot_time: 75.1µs, rocksdb: {delete_skipped_count: 75, key_skipped_count: 1075, block: {cache_hit_count: 10}}}    | range:["yes","yes"], keep order:false | N/A     | N/A  |
| └─TableRowIDScan_6(Probe)     | 911.94  | 200     | cop[tikv] | table:t              | time:20.9ms, loops:2, cop_task: {num: 200, max: 6.19ms, min: 473.4µs, avg: 3.04ms, p95: 5.34ms, max_proc_keys: 1, p95_proc_keys: 1, rpc_num: 200, rpc_time: 603.1ms, copr_cache: disabled, distsql_concurrency: 15}, tikv_task:{proc max:1ms, min:0s, avg: 30µs, p80:0s, p95:0s, iters:200, tasks:200}, scan_detail: {total_process_keys: 200, total_process_keys_size: 9185, total_keys: 200, get_snapshot_time: 7.72ms, rocksdb: {block: {cache_hit_count: 314}}}                                                          | keep order:false                      | N/A     | N/A  |
+-------------------------------+---------+---------+-----------+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+---------+------+
3 rows in set (0.036 sec)

3. What did you see instead (Required)

actRows should be 1,000, if the coprocessor cache is turned off, total_process_keys should also be at least 1,000.

4. What is your TiDB version? (Required)

Release Version: v6.5.0
Edition: Community
Git Commit Hash: 706c3fa3c526cdba5b3e9f066b1a568fb96c56e3
Git Branch: heads/refs/tags/v6.5.0
UTC Build Time: 2022-12-27 03:50:44
GoVersion: go1.19.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants