Details
Description
create table ten(a int);
|
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
create table one_k(a int);
|
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
|
create table t1 (
|
pk varchar(50),
|
a varchar(20),
|
filler varchar(100),
|
index(a),
|
primary key(pk)
|
) engine=innodb;
|
insert into t1 select a,a,a from test.one_k;
|
explain select pk from t1 order by a;
|
id select_type table type possible_keys key key_len ref rows Extra
|
1 SIMPLE t1 index NULL a 25 NULL 1120 Using index
|
The key_len=25 does not make any sense. They key format is
offset what
0-1 Column a, NULL-byte
1-3 Column a, length bytes
3-23 Column a, 20 characters
23-25 PK, length bytes
25- PK, 50 values
25 bytes means include PK's length but not include the PK value itself.
Attachments
Issue Links
- relates to
-
MDEV-9658 Make MyRocks in MariaDB stable
- Closed