-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util/ranger: don't exclude start key for range from
_
in like
fun…
- Loading branch information
1 parent
e6732ae
commit eb96350
Showing
5 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
drop table if exists t1, t2; | ||
create table t1(a varchar(20) collate utf8mb4_bin, index ia(a)); | ||
insert into t1 value('测试'),('测试 '),('xxx '); | ||
explain format = brief select *,length(a) from t1 where a like '测试 %'; | ||
id estRows task access object operator info | ||
Projection 250.00 root test.t1.a, length(test.t1.a)->Column#3 | ||
└─IndexReader 250.00 root index:IndexRangeScan | ||
└─IndexRangeScan 250.00 cop[tikv] table:t1, index:ia(a) range:["测试 ","测试!"), keep order:false, stats:pseudo | ||
explain format = brief select *,length(a) from t1 where a like '测试'; | ||
id estRows task access object operator info | ||
Projection 10.00 root test.t1.a, length(test.t1.a)->Column#3 | ||
└─IndexReader 10.00 root index:IndexRangeScan | ||
└─IndexRangeScan 10.00 cop[tikv] table:t1, index:ia(a) range:["测试","测试"], keep order:false, stats:pseudo | ||
select *,length(a) from t1 where a like '测试 %'; | ||
a length(a) | ||
测试 6 | ||
测试 8 | ||
select *,length(a) from t1 where a like '测试'; | ||
a length(a) | ||
测试 6 | ||
测试 8 | ||
explain format = brief select * from t1 use index (ia) where a like 'xxx_'; | ||
id estRows task access object operator info | ||
IndexReader 250.00 root index:Selection | ||
└─Selection 250.00 cop[tikv] like(test.t1.a, "xxx_", 92) | ||
└─IndexRangeScan 250.00 cop[tikv] table:t1, index:ia(a) range:["xxx","xxy"), keep order:false, stats:pseudo | ||
select * from t1 use index (ia) where a like 'xxx_'; | ||
a | ||
xxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# https://github.com/pingcap/tidb/issues/48983 | ||
drop table if exists t1, t2; | ||
create table t1(a varchar(20) collate utf8mb4_bin, index ia(a)); | ||
insert into t1 value('测试'),('测试 '),('xxx '); | ||
explain format = brief select *,length(a) from t1 where a like '测试 %'; | ||
explain format = brief select *,length(a) from t1 where a like '测试'; | ||
select *,length(a) from t1 where a like '测试 %'; | ||
select *,length(a) from t1 where a like '测试'; | ||
explain format = brief select * from t1 use index (ia) where a like 'xxx_'; | ||
select * from t1 use index (ia) where a like 'xxx_'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters