-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/release-5.0' into err-key-exis…
…ts-5.0
- Loading branch information
Showing
37 changed files
with
860 additions
and
244 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,30 @@ | ||
use test; | ||
drop table if exists t; | ||
create table t( | ||
customer_id bigint, | ||
id bigint, | ||
expected_shard bigint unsigned, | ||
computed_shard bigint unsigned null, | ||
primary key (customer_id, id) | ||
); | ||
create index t_vitess_shard on t((vitess_hash(customer_id) >> 56)); | ||
explain format = 'brief' select customer_id from t where (vitess_hash(customer_id) >> 56) = x'd6' ORDER BY id; | ||
id estRows task access object operator info | ||
Projection 10.00 root test.t.customer_id | ||
└─Sort 10.00 root test.t.id | ||
└─IndexLookUp 10.00 root | ||
├─IndexRangeScan(Build) 10.00 cop[tikv] table:t, index:t_vitess_shard(vitess_hash(`customer_id`) >> 56) range:[214,214], keep order:false, stats:pseudo | ||
└─TableRowIDScan(Probe) 10.00 cop[tikv] table:t keep order:false, stats:pseudo | ||
explain format = 'brief' select id from t where (vitess_hash(customer_id) >> 56) IN (x'e0', x'e1') AND id BETWEEN 2 AND 5 ORDER BY id; | ||
id estRows task access object operator info | ||
Projection 0.50 root test.t.id | ||
└─Sort 0.50 root test.t.id | ||
└─IndexLookUp 0.50 root | ||
├─IndexRangeScan(Build) 20.00 cop[tikv] table:t, index:t_vitess_shard(vitess_hash(`customer_id`) >> 56) range:[224,224], [225,225], keep order:false, stats:pseudo | ||
└─Selection(Probe) 0.50 cop[tikv] ge(test.t.id, 2), le(test.t.id, 5) | ||
└─TableRowIDScan 20.00 cop[tikv] table:t keep order:false, stats:pseudo | ||
explain format = 'brief' select hex(vitess_hash(1123)) from t; | ||
id estRows task access object operator info | ||
Projection 10000.00 root 31B565D41BDF8CA->Column#7 | ||
└─IndexReader 10000.00 root index:IndexFullScan | ||
└─IndexFullScan 10000.00 cop[tikv] table:t, index:t_vitess_shard(vitess_hash(`customer_id`) >> 56) keep order:false, stats:pseudo |
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,13 @@ | ||
use test; | ||
drop table if exists t; | ||
create table t( | ||
customer_id bigint, | ||
id bigint, | ||
expected_shard bigint unsigned, | ||
computed_shard bigint unsigned null, | ||
primary key (customer_id, id) | ||
); | ||
create index t_vitess_shard on t((vitess_hash(customer_id) >> 56)); | ||
explain format = 'brief' select customer_id from t where (vitess_hash(customer_id) >> 56) = x'd6' ORDER BY id; | ||
explain format = 'brief' select id from t where (vitess_hash(customer_id) >> 56) IN (x'e0', x'e1') AND id BETWEEN 2 AND 5 ORDER BY id; | ||
explain format = 'brief' select hex(vitess_hash(1123)) from t; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.