Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
Originally described here: https://bugs.mysql.com/bug.php?id=84958
If there're multiple row versions in InnoDB, reading one row from PK may have O(N) complexity and reading from secondary keys may have O(N^2) complexity.
How to repeat:
setup: create table t1 (a int, b int, c int, primary key(a,b), key (b,c)) engine=InnoDB;
T1: BEGIN; SELECT * FROM t1;
T2: 10000 * INSERT INTO t1 VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1
T1: SELECT * FROM t1 FORCE INDEX (PRIMARY)
(this will be immediate and bump Innodb_buffer_pool_read_requests by ~10k)
T1: SELECT * FROM t1 FORCE INDEX (b)
(this will be not immediate and bump Innodb_buffer_pool_read_requests by ~100000k or ~100m or....)
Operator: *weep* *sob* *weep*
Attachments
Issue Links
- causes
-
MDEV-20389 The test innodb.innodb_bug84958 fails intermittently
- Closed
-
MDEV-22924 Warning InnoDB: Index 'Marvão_idx3' contains 36 entries, should be 37.
- Closed
- is blocked by
-
MDEV-20341 Unstable innodb.innodb_bug14704286
- Closed
- relates to
-
MDEV-17598 InnoDB index option for per-record transaction ID
- Open
-
MDEV-31589 Secondary index MVCC access is unnecessarily inefficient
- Stalled
- links to