mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
9bfc910f2f
SECONDARY INDEX UPDATES MAKE CONSISTENT READS DO O(N^2) UNDO PAGE LOOKUPS (honoring kill query while accessing sec_index) If secondary index is being used for select query evaluation and this query is operating with consistent read snapshot it might take good time for secondary index to return back control to mysql as MVCC would kick in. If user issues "kill query <id>" while query is actively accessing secondary index it will not be honored as there is no hook to check for this condition. Added hook for this check. ----- Parallely secondary index taking too long to evaluate for consistent read snapshot case is being examined for performance improvement. WL#6540.
43 lines
1 KiB
Text
43 lines
1 KiB
Text
use test;
|
|
drop table if exists t1;
|
|
Warnings:
|
|
Note 1051 Unknown table 't1'
|
|
create table t1 (id int primary key, value int, value2 int,
|
|
value3 int, index(value,value2)) engine=innodb;
|
|
insert into t1 values
|
|
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
|
|
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
|
|
(20,20,20,20);
|
|
use test;
|
|
start transaction with consistent snapshot;
|
|
use test;
|
|
CREATE PROCEDURE update_t1()
|
|
BEGIN
|
|
DECLARE i INT DEFAULT 1;
|
|
while (i <= 5000) DO
|
|
update test.t1 set value2=value2+1, value3=value3+1 where id=12;
|
|
SET i = i + 1;
|
|
END WHILE;
|
|
END|
|
|
CALL update_t1();
|
|
select * from t1;
|
|
id value value2 value3
|
|
10 10 10 10
|
|
11 11 11 11
|
|
12 12 5012 5012
|
|
13 13 13 13
|
|
14 14 14 14
|
|
15 15 15 15
|
|
16 16 16 16
|
|
17 17 17 17
|
|
18 18 18 18
|
|
19 19 19 19
|
|
20 20 20 20
|
|
select * from t1 force index(value) where value=12;
|
|
kill query @id;
|
|
ERROR 70100: Query execution was interrupted
|
|
select * from t1 where value = 12;
|
|
id value value2 value3
|
|
12 12 12 12
|
|
drop procedure if exists update_t1;
|
|
drop table if exists t1;
|