Commit 5a1d9315 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent fae70d6b
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
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;
begin;
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_576;
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d, rtr_page_need_second_split';
insert into t1 select * from t1;
SET debug_dbug = '+d,rtr_page_need_second_split';
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_576;
SET debug_dbug = @saved_dbug;
delete from t1;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
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;
insert into t1 select * from t1;
insert into t1 select * from t1;
start transaction;
insert into t1 select * from t1;
rollback;
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_2304;
begin;
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_2304;
rollback;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
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 @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_71424;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
......
# 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
--source include/not_embedded.inc
......@@ -8,65 +8,33 @@
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_sequence.inc
# Create table with R-tree index.
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
begin;
# Insert enough values to let R-tree split.
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
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;
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_576;
#Check second round spliting.
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d, rtr_page_need_second_split';
insert into t1 select * from t1;
SET debug_dbug = '+d,rtr_page_need_second_split';
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_576;
SET debug_dbug = @saved_dbug;
rollback;
delete from t1;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
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;
insert into t1 select * from t1;
insert into t1 select * from t1;
start transaction;
insert into t1 select * from t1;
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_2304;
begin;
insert into t1 select @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_2304;
rollback;
check table 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 @s:=1+(seq mod 9), point(@s, @s)
from seq_1_to_71424;
check table t1;
select count(*) from t1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment