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

The global index not work with IndexMerge executor #43013

Closed
Defined2014 opened this issue Apr 13, 2023 · 0 comments · Fixed by #52971
Closed

The global index not work with IndexMerge executor #43013

Defined2014 opened this issue Apr 13, 2023 · 0 comments · Fixed by #52971
Assignees
Labels
component/tablepartition This issue is related to Table Partition of TiDB. feature/developing the related feature is in development sig/sql-infra SIG: SQL Infra type/new-feature

Comments

@Defined2014
Copy link
Contributor

Defined2014 commented Apr 13, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set tidb_enable_global_index = true;
mysql> show create table tpk2;
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                             |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tpk2  | CREATE TABLE `tpk2` (
  `a` int(11) DEFAULT NULL,
  `b` int(11) DEFAULT NULL,
  `c` int(11) NOT NULL,
  `d` int(11) NOT NULL AUTO_INCREMENT,
  KEY `idx_bc` (`b`,`c`),
  UNIQUE KEY `uidx_ac` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30002
PARTITION BY HASH (`c`) PARTITIONS 2 |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

insert into tpk2 values (1, 1, 1, 1), (2, 2, 2, 2);

mysql> select /*+ use_index_merge(tpk2, uidx_ac, idx_bc) */ * from tpk2 where a=1 or b=2;
+------+------+---+---+
| a    | b    | c | d |
+------+------+---+---+
|    2 |    2 | 2 | 2 |
+------+------+---+---+
1 row in set (0.01 sec)

mysql> select * from tpk2 where a=1 or b=2;
+------+------+---+---+
| a    | b    | c | d |
+------+------+---+---+
|    2 |    2 | 2 | 2 |
|    1 |    1 | 1 | 1 |
+------+------+---+---+
2 rows in set (0.01 sec)

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

The result is same with using indexMerge or not.

3. What did you see instead (Required)

The results are different.

4. What is your TiDB version? (Required)

@Defined2014 Defined2014 added type/bug This issue is a bug. severity/major component/tablepartition This issue is related to Table Partition of TiDB. feature/developing the related feature is in development labels Apr 13, 2023
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 13, 2023
@Defined2014 Defined2014 removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-6.1 may-affects-6.5 labels Apr 13, 2023
@Defined2014 Defined2014 added the sig/sql-infra SIG: SQL Infra label Apr 14, 2023
@Defined2014 Defined2014 removed type/bug This issue is a bug. severity/moderate labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. feature/developing the related feature is in development sig/sql-infra SIG: SQL Infra type/new-feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants