mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Speed up innodb_gis.rtree_split
INSERT...SELECT reading from an InnoDB table is slow due to creating explicit record locks. Use the sequence engine instead. Also, remove the space before rtr_page_need_second_split to actually make the debug injection work.
This commit is contained in:
@ -1,52 +1,24 @@
|
|||||||
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
|
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
|
||||||
insert into t1 values(1, Point(1,1));
|
begin;
|
||||||
insert into t1 values(2, Point(2,2));
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 values(3, Point(3,3));
|
from seq_1_to_576;
|
||||||
insert into t1 values(4, Point(4,4));
|
|
||||||
insert into t1 values(5, Point(5,5));
|
|
||||||
insert into t1 values(6, Point(6,6));
|
|
||||||
insert into t1 values(7, Point(7,7));
|
|
||||||
insert into t1 values(8, Point(8,8));
|
|
||||||
insert into t1 values(9, Point(9,9));
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
SET @saved_dbug = @@SESSION.debug_dbug;
|
SET @saved_dbug = @@SESSION.debug_dbug;
|
||||||
SET debug_dbug = '+d, rtr_page_need_second_split';
|
SET debug_dbug = '+d,rtr_page_need_second_split';
|
||||||
insert into t1 select * from t1;
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
|
from seq_1_to_576;
|
||||||
SET debug_dbug = @saved_dbug;
|
SET debug_dbug = @saved_dbug;
|
||||||
delete from t1;
|
rollback;
|
||||||
insert into t1 values(1, Point(1,1));
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 values(2, Point(2,2));
|
from seq_1_to_2304;
|
||||||
insert into t1 values(3, Point(3,3));
|
begin;
|
||||||
insert into t1 values(4, Point(4,4));
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 values(5, Point(5,5));
|
from seq_1_to_2304;
|
||||||
insert into t1 values(6, Point(6,6));
|
|
||||||
insert into t1 values(7, Point(7,7));
|
|
||||||
insert into t1 values(8, Point(8,8));
|
|
||||||
insert into t1 values(9, Point(9,9));
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
start transaction;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
rollback;
|
rollback;
|
||||||
check table t1;
|
check table t1;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 check status OK
|
test.t1 check status OK
|
||||||
insert into t1 select * from t1;
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 select * from t1;
|
from seq_1_to_71424;
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
check table t1;
|
check table t1;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 check status OK
|
test.t1 check status OK
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# WL#6745 InnoDB R-tree support
|
# WL#6745 InnoDB R-tree support
|
||||||
# This test case will test R-tree split, mostly on duplciate records.
|
# This test case will test R-tree split, mostly on duplicate records.
|
||||||
|
|
||||||
# Not supported in embedded
|
# Not supported in embedded
|
||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
@ -8,65 +8,33 @@
|
|||||||
--source include/big_test.inc
|
--source include/big_test.inc
|
||||||
--source include/not_valgrind.inc
|
--source include/not_valgrind.inc
|
||||||
--source include/have_debug.inc
|
--source include/have_debug.inc
|
||||||
|
--source include/have_sequence.inc
|
||||||
|
|
||||||
# Create table with R-tree index.
|
# Create table with R-tree index.
|
||||||
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
|
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
|
||||||
|
|
||||||
|
begin;
|
||||||
# Insert enough values to let R-tree split.
|
# Insert enough values to let R-tree split.
|
||||||
insert into t1 values(1, Point(1,1));
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 values(2, Point(2,2));
|
from seq_1_to_576;
|
||||||
insert into t1 values(3, Point(3,3));
|
|
||||||
insert into t1 values(4, Point(4,4));
|
|
||||||
insert into t1 values(5, Point(5,5));
|
|
||||||
insert into t1 values(6, Point(6,6));
|
|
||||||
insert into t1 values(7, Point(7,7));
|
|
||||||
insert into t1 values(8, Point(8,8));
|
|
||||||
insert into t1 values(9, Point(9,9));
|
|
||||||
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
|
|
||||||
#Check second round spliting.
|
#Check second round spliting.
|
||||||
SET @saved_dbug = @@SESSION.debug_dbug;
|
SET @saved_dbug = @@SESSION.debug_dbug;
|
||||||
SET debug_dbug = '+d, rtr_page_need_second_split';
|
SET debug_dbug = '+d,rtr_page_need_second_split';
|
||||||
insert into t1 select * from t1;
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
|
from seq_1_to_576;
|
||||||
SET debug_dbug = @saved_dbug;
|
SET debug_dbug = @saved_dbug;
|
||||||
|
rollback;
|
||||||
|
|
||||||
delete from t1;
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
|
from seq_1_to_2304;
|
||||||
insert into t1 values(1, Point(1,1));
|
begin;
|
||||||
insert into t1 values(2, Point(2,2));
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 values(3, Point(3,3));
|
from seq_1_to_2304;
|
||||||
insert into t1 values(4, Point(4,4));
|
|
||||||
insert into t1 values(5, Point(5,5));
|
|
||||||
insert into t1 values(6, Point(6,6));
|
|
||||||
insert into t1 values(7, Point(7,7));
|
|
||||||
insert into t1 values(8, Point(8,8));
|
|
||||||
insert into t1 values(9, Point(9,9));
|
|
||||||
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
start transaction;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
rollback;
|
rollback;
|
||||||
check table t1;
|
check table t1;
|
||||||
insert into t1 select * from t1;
|
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
|
||||||
insert into t1 select * from t1;
|
from seq_1_to_71424;
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
insert into t1 select * from t1;
|
|
||||||
check table t1;
|
check table t1;
|
||||||
|
|
||||||
select count(*) from t1;
|
select count(*) from t1;
|
||||||
|
Reference in New Issue
Block a user