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

Didn't tracker memory usage of IndexMergeReader #30208

Closed
guo-shaoge opened this issue Nov 29, 2021 · 0 comments · Fixed by #30210
Closed

Didn't tracker memory usage of IndexMergeReader #30208

guo-shaoge opened this issue Nov 29, 2021 · 0 comments · Fixed by #30210
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@guo-shaoge
Copy link
Collaborator

guo-shaoge commented Nov 29, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1;
create table t1(c1 varchar(100), c2 varchar(100), c3 varchar(100), key(c1), key(c2));
load data local infile '/home/guo-shaoge/str.sql' into table t1 fields terminated by ' ';
select /*+ use_index_merge(t1) */ * from t1 where c1 < '10' or c2 < '10'; 

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

The memory column is 312Bytes.

mysql> explain analyze select /*+ use_index_merge(t1) */ * from t1 where c1 < '10' or c2 < '10';
+-------------------------------+---------+---------+-----------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+-----------+------+
| id                            | estRows | actRows | task      | access object          | execution info                                                                                                                                                         | operator info
                   | memory    | disk |
+-------------------------------+---------+---------+-----------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+-----------+------+
| IndexMerge_8                  | 5542.21 | 0       | root      |                        | time:3.98ms, loops:1,                                                                                                                                                  |
                   | 312 Bytes | N/A  |
| ├─IndexRangeScan_5(Build)     | 3323.33 | 0       | cop[tikv] | table:t1, index:c1(c1) | time:0s, loops:0, cop_task: {num: 1, max: 3.67ms, proc_keys: 0, tot_proc: 3ms, rpc_num: 1, rpc_time: 3.66ms, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:0} | range:[-inf,"10"), keep order:false, stats:pseudo | N/A       | N/A  |
| ├─IndexRangeScan_6(Build)     | 3323.33 | 0       | cop[tikv] | table:t1, index:c2(c2) | time:0s, loops:0, cop_task: {num: 1, max: 3.65ms, proc_keys: 0, tot_proc: 3ms, rpc_num: 1, rpc_time: 3.63ms, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:0} | range:[-inf,"10"), keep order:false, stats:pseudo | N/A       | N/A  |
| └─TableRowIDScan_7(Probe)     | 5542.21 | 0       | cop[tikv] | table:t1               |                                                                                                                                                                        | keep order:false, stats:pseudo                    | N/A       | N/A  |
+-------------------------------+---------+---------+-----------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+-----------+------+

3. What did you see instead (Required)

The memory column is N/A

mysql> explain analyze select /*+ use_index_merge(t1) */ * from t1 where c1 < '10' or c2 < '10';
+-------------------------------+---------+---------+-----------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------+------+
| id                            | estRows | actRows | task      | access object          | execution info                                                                                                                                                         | operator info                                     | memory | disk |
+-------------------------------+---------+---------+-----------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------+------+
| IndexMerge_8                  | 5542.21 | 0       | root      |                        | time:4.3ms, loops:1,                                                                                                                                                   |                                                   | N/A    | N/A  |
| ├─IndexRangeScan_5(Build)     | 3323.33 | 0       | cop[tikv] | table:t1, index:c1(c1) | time:0s, loops:0, cop_task: {num: 1, max: 4.03ms, proc_keys: 0, tot_proc: 3ms, rpc_num: 1, rpc_time: 4ms, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:0}    | range:[-inf,"10"), keep order:false, stats:pseudo | N/A    | N/A  |
| ├─IndexRangeScan_6(Build)     | 3323.33 | 0       | cop[tikv] | table:t1, index:c2(c2) | time:0s, loops:0, cop_task: {num: 1, max: 3.93ms, proc_keys: 0, tot_proc: 3ms, rpc_num: 1, rpc_time: 3.91ms, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:0} | range:[-inf,"10"), keep order:false, stats:pseudo | N/A    | N/A  |
| └─TableRowIDScan_7(Probe)     | 5542.21 | 0       | cop[tikv] | table:t1               |                                                                                                                                                                        | keep order:false, stats:pseudo                    | N/A    | N/A  |
+-------------------------------+---------+---------+-----------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------+------+

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
                          |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.4.0-alpha-241-g7a8c7f89ce
Edition: Community
Git Commit Hash: 7a8c7f89cebe0e5596415a6106b1345cec9cfa27
Git Branch: master
UTC Build Time: 2021-11-28 02:32:15
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@guo-shaoge guo-shaoge added the type/bug The issue is confirmed as a bug. label Nov 29, 2021
@guo-shaoge guo-shaoge self-assigned this Nov 29, 2021
@XuHuaiyu XuHuaiyu added type/enhancement The issue or PR belongs to an enhancement. and removed sig/execution SIG execution severity/moderate labels Dec 1, 2021
@shuke987 shuke987 removed the type/bug The issue is confirmed as a bug. label Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants