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

missing build and probe suffix for index merge operator #15205

Closed
zz-jason opened this issue Mar 8, 2020 · 1 comment · Fixed by #15507
Closed

missing build and probe suffix for index merge operator #15205

zz-jason opened this issue Mar 8, 2020 · 1 comment · Fixed by #15507
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Milestone

Comments

@zz-jason
Copy link
Member

zz-jason commented Mar 8, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

enable index merge, check the execution plan:

TiDB(root@127.0.0.1:test) > create table t (a bigint, b bigint, index idx_a(a), index idx_b(b));
Query OK, 0 rows affected (0.01 sec)

TiDB(root@127.0.0.1:test) > set @@tidb_enable_index_merge = 1;
Query OK, 0 rows affected (0.00 sec)

TiDB(root@127.0.0.1:test) > desc select * from t use index(idx_a, idx_b) where a > 1 or b > 1;
+-------------------------+---------+-----------+------------------------------------------------------------------+
| id                      | estRows | task      | operator info                                                    |
+-------------------------+---------+-----------+------------------------------------------------------------------+
| IndexMerge_16           | 6666.67 | root      |                                                                  |
| ├─IndexRangeScan_13     | 3333.33 | cop[tikv] | table:t, index:a, range:(1,+inf], keep order:false, stats:pseudo |
| ├─IndexRangeScan_14     | 3333.33 | cop[tikv] | table:t, index:b, range:(1,+inf], keep order:false, stats:pseudo |
| └─TableRowIDScan_15     | 6666.67 | cop[tikv] | table:t, keep order:false, stats:pseudo                          |
+-------------------------+---------+-----------+------------------------------------------------------------------+
4 rows in set (0.00 sec)

2. What did you expect to see?

show the build and probe side as index lookup did:

TiDB(root@127.0.0.1:test) > desc select * from t use index(idx_a) where a > 1 or b > 1;
+------------------------------+----------+-----------+--------------------------------------------------+
| id                           | estRows  | task      | operator info                                    |
+------------------------------+----------+-----------+--------------------------------------------------+
| IndexLookUp_8                | 8000.00  | root      |                                                  |
| ├─IndexFullScan_5(Build)     | 10000.00 | cop[tikv] | table:t, index:a, keep order:false, stats:pseudo |
| └─Selection_7(Probe)         | 8000.00  | cop[tikv] | or(gt(test.t.a, 1), gt(test.t.b, 1))             |
|   └─TableRowIDScan_6         | 10000.00 | cop[tikv] | table:t, keep order:false, stats:pseudo          |
+------------------------------+----------+-----------+--------------------------------------------------+
4 rows in set (0.00 sec)

3. What did you see instead?

didn't show these two suffixes.

4. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

TiDB(root@127.0.0.1:test) > select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta-329-g0aef6eca2
Git Commit Hash: 0aef6eca2c661a69819f403be20a743a978cbe70
Git Branch: master
UTC Build Time: 2020-03-08 04:56:50
GoVersion: go1.13.8
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.01 sec)
@zz-jason zz-jason added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner labels Mar 8, 2020
@zz-jason zz-jason added this to the 4.0.0-rc milestone Mar 8, 2020
@LittleFall
Copy link
Contributor

Is this your expectation?

+--------------------------------+---------+-----------+------------------------------------------------------------------+
| id                             | estRows | task      | operator info                                                    |
+--------------------------------+---------+-----------+------------------------------------------------------------------+
| IndexMerge_16                  | 6666.67 | root      |                                                                  |
| ├─IndexRangeScan_13 (Build)    | 3333.33 | cop[tikv] | table:t, index:a, range:(1,+inf], keep order:false, stats:pseudo |
| ├─IndexRangeScan_14 (Build)    | 3333.33 | cop[tikv] | table:t, index:b, range:(1,+inf], keep order:false, stats:pseudo |
| └─TableRowIDScan_15 (Probe)    | 6666.67 | cop[tikv] | table:t, keep order:false, stats:pseudo                          |
+--------------------------------+---------+-----------+------------------------------------------------------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@zz-jason @sre-bot @LittleFall and others