Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
af05becb
Commit
af05becb
authored
Nov 16, 2016
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-10771: Test innodb_defragment_fill_factor does not work correctly
Added more columns to stabilice the test case.
parent
bccd0b5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
176 additions
and
92 deletions
+176
-92
mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
...-test/suite/innodb/r/innodb_defragment_fill_factor.result
+83
-43
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
+93
-49
No files found.
mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
View file @
af05becb
DROP TABLE if exists t1;
DROP TABLE if exists t2;
Testing tables with large records
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
KEY SECOND(a, b
)) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('A', 256));
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
c VARCHAR(256), KEY SECOND(a, b,c
)) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('A', 256)
, REPEAT('B', 256)
);
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
...
...
@@ -16,9 +16,6 @@ INSERT INTO t1 (b) SELECT b from t1;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
select sleep(1);
sleep(1)
0
select count(*) from t1;
count(*)
927
...
...
@@ -26,51 +23,94 @@ select count(*) from t1 force index (second);
count(*)
927
# A few more insertions on the page should not cause a page split.
insert into t1 values (81, REPEAT('A', 256));
insert into t1 values (83, REPEAT('A', 256));
insert into t1 values (87, REPEAT('A', 256));
insert into t1 values (82, REPEAT('A', 256));
insert into t1 values (86, REPEAT('A', 256));
# More insertions will cause page splits
insert into t1 values (88, REPEAT('A', 256));
insert into t1 values (85, REPEAT('A', 256));
insert into t1 values (84, REPEAT('A', 256));
insert into t1 values (81, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (83, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (87, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (82, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (86, REPEAT('A', 256), REPEAT('B', 256));
# Insert more rows to cause a page split
insert into t1 values (180, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (181, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (182, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (183, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (184, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (185, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (186, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (187, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (188, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (189, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (190, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (191, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (192, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (193, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (194, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (195, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (196, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (197, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (198, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (199, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (200, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (201, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (202, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (203, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (204, REPEAT('A', 256), REPEAT('B', 256));
DROP TABLE t1;
Testing table with small records
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VAR
char(16), KEY SECOND(a,b
)) ENGINE=INNODB;
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VAR
CHAR(16), c VARCHAR(32), KEY SECOND(a,b,c
)) ENGINE=INNODB;
optimize table t2;
Table Op Msg_type Msg_text
test.t2 optimize status OK
select
sleep(1)
;
sleep(1
)
0
select
count(*) from t2
;
count(*
)
3701
select count(*) from t2 force index(second);
count(*)
3701
The page should have room for about 20 insertions
insert into t2 values(1181, REPEAT('A', 16));
insert into t2 values(1191, REPEAT('A', 16));
insert into t2 values(1182, REPEAT('A', 16));
insert into t2 values(1192, REPEAT('A', 16));
insert into t2 values(1183, REPEAT('A', 16));
insert into t2 values(1193, REPEAT('A', 16));
insert into t2 values(1184, REPEAT('A', 16));
insert into t2 values(1194, REPEAT('A', 16));
insert into t2 values(1185, REPEAT('A', 16));
insert into t2 values(1195, REPEAT('A', 16));
insert into t2 values(1186, REPEAT('A', 16));
insert into t2 values(1196, REPEAT('A', 16));
insert into t2 values(1187, REPEAT('A', 16));
insert into t2 values(1197, REPEAT('A', 16));
insert into t2 values(1188, REPEAT('A', 16));
insert into t2 values(1198, REPEAT('A', 16));
insert into t2 values(1189, REPEAT('A', 16));
insert into t2 values(1199, REPEAT('A', 16));
insert into t2 values(1190, REPEAT('A', 16));
insert into t2 values(1180, REPEAT('A', 16));
More insertions will cause page split.
insert into t2 values(1280, REPEAT('A', 16));
insert into t2 values(1290, REPEAT('A', 16));
insert into t2 values(1281, REPEAT('A', 16));
insert into t2 values(1291, REPEAT('A', 16));
insert into t2 values(1181, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1191, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1182, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1192, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1183, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1193, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1184, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1194, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1185, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1195, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1186, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1196, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1187, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1197, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1188, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1198, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1189, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1199, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1190, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1180, REPEAT('A', 16), REPEAT('B',32));
# Insert more rows to cause a page split
insert into t2 values (180, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (181, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (182, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (183, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (184, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (185, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (186, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (187, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (188, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (189, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (190, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (191, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (192, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (193, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (194, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (195, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (196, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (197, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (198, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (199, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (200, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (201, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (202, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (203, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (204, REPEAT('A', 16), REPEAT('B', 32));
DROP TABLE t2;
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
View file @
af05becb
...
...
@@ -11,10 +11,10 @@ DROP TABLE if exists t2;
--
echo
Testing
tables
with
large
records
# Create table.
CREATE
TABLE
t1
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VARCHAR
(
256
),
KEY
SECOND
(
a
,
b
))
ENGINE
=
INNODB
;
CREATE
TABLE
t1
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VARCHAR
(
256
),
c
VARCHAR
(
256
),
KEY
SECOND
(
a
,
b
,
c
))
ENGINE
=
INNODB
;
# Populate table.
INSERT
INTO
t1
VALUES
(
1
,
REPEAT
(
'A'
,
256
));
INSERT
INTO
t1
VALUES
(
1
,
REPEAT
(
'A'
,
256
)
,
REPEAT
(
'B'
,
256
)
);
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
...
...
@@ -36,28 +36,24 @@ while ($size)
}
--
enable_query_log
--
source
include
/
wait_innodb_all_purged
.
inc
--
source
include
/
restart_mysqld
.
inc
optimize
table
t1
;
select
sleep
(
1
);
--
source
include
/
restart_mysqld
.
inc
select
count
(
*
)
from
t1
;
# After deletion & defragmentation, there are 800 records left. Each page can hold about 57 records. We fill the page 90% full,
# so there should be less than 16 pages total.
--
let
$primary_before
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'PRIMARY'
,
Value
,
1
)
select
count
(
*
)
from
t1
force
index
(
second
);
# secondary index is slightly bigger than primary index so the number of pages should be similar.
--
let
$second_before
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'second'
,
Value
,
1
)
--
echo
# A few more insertions on the page should not cause a page split.
insert
into
t1
values
(
81
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
83
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
87
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
82
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
86
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
81
,
REPEAT
(
'A'
,
256
)
,
REPEAT
(
'B'
,
256
)
);
insert
into
t1
values
(
83
,
REPEAT
(
'A'
,
256
)
,
REPEAT
(
'B'
,
256
)
);
insert
into
t1
values
(
87
,
REPEAT
(
'A'
,
256
)
,
REPEAT
(
'B'
,
256
)
);
insert
into
t1
values
(
82
,
REPEAT
(
'A'
,
256
)
,
REPEAT
(
'B'
,
256
)
);
insert
into
t1
values
(
86
,
REPEAT
(
'A'
,
256
)
,
REPEAT
(
'B'
,
256
)
);
--
let
$primary_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'PRIMARY'
,
Value
,
1
)
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'second'
,
Value
,
1
)
...
...
@@ -69,28 +65,52 @@ if ($second_before != $second_after) {
--
echo
Insertion
caused
page
split
on
second
,
which
should
be
avoided
by
innodb_defragment_fill_factor
.
}
--
echo
# More insertions will cause page splits
insert
into
t1
values
(
88
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
85
,
REPEAT
(
'A'
,
256
));
insert
into
t1
values
(
84
,
REPEAT
(
'A'
,
256
));
--
echo
# Insert more rows to cause a page split
insert
into
t1
values
(
180
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
181
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
182
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
183
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
184
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
185
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
186
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
187
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
188
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
189
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
190
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
191
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
192
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
193
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
194
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
195
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
196
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
197
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
198
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
199
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
200
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
201
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
202
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
203
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
204
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
--
let
$primary_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'PRIMARY'
,
Value
,
1
)
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'second'
,
Value
,
1
)
if
(
$primary_before
==
$primary_after
)
{
--
echo
Too
much
space
are
reserved
on
primary
index
.
--
echo
Too
little
space
is
reserved
on
primary
index
.
}
if
(
$second_before
==
$second_after
)
{
--
echo
Too
much
space
are
reserved
on
second
index
.
--
echo
Too
little
space
is
reserved
on
second
index
.
}
DROP
TABLE
t1
;
--
echo
Testing
table
with
small
records
CREATE
TABLE
t2
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VAR
char
(
16
),
KEY
SECOND
(
a
,
b
))
ENGINE
=
INNODB
;
CREATE
TABLE
t2
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VAR
CHAR
(
16
),
c
VARCHAR
(
32
),
KEY
SECOND
(
a
,
b
,
c
))
ENGINE
=
INNODB
;
# Populate table.
--
disable_query_log
INSERT
INTO
t2
VALUES
(
1
,
REPEAT
(
'A'
,
16
));
INSERT
INTO
t2
VALUES
(
1
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
...
...
@@ -115,36 +135,36 @@ while ($size)
}
--
enable_query_log
--
source
include
/
wait_innodb_all_purged
.
inc
--
source
include
/
restart_mysqld
.
inc
optimize
table
t2
;
select
sleep
(
1
);
--
source
include
/
restart_mysqld
.
inc
select
count
(
*
)
from
t2
;
select
count
(
*
)
from
t2
force
index
(
second
);
--
let
$second_before
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t2%'
and
index_name
=
'second'
,
Value
,
1
)
--
echo
The
page
should
have
room
for
about
20
insertions
insert
into
t2
values
(
1181
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1191
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1182
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1192
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1183
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1193
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1184
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1194
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1185
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1195
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1186
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1196
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1187
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1197
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1188
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1198
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1189
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1199
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1190
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1180
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1181
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1191
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1182
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1192
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1183
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1193
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1184
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1194
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1185
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1195
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1186
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1196
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1187
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1197
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1188
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1198
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1189
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1199
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1190
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
insert
into
t2
values
(
1180
,
REPEAT
(
'A'
,
16
)
,
REPEAT
(
'B'
,
32
)
);
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t2%'
and
index_name
=
'second'
,
Value
,
1
)
...
...
@@ -152,15 +172,39 @@ if ($second_before != $second_after) {
--
echo
Insertion
caused
page
split
on
second
,
which
should
be
avoided
by
innodb_defragment_fill_factor
.
}
--
echo
More
insertions
will
cause
page
split
.
insert
into
t2
values
(
1280
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1290
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1281
,
REPEAT
(
'A'
,
16
));
insert
into
t2
values
(
1291
,
REPEAT
(
'A'
,
16
));
--
echo
# Insert more rows to cause a page split
insert
into
t2
values
(
180
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
181
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
182
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
183
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
184
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
185
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
186
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
187
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
188
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
189
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
190
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
191
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
192
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
193
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
194
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
195
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
196
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
197
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
198
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
199
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
200
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
201
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
202
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
203
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
204
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t2%'
and
index_name
=
'second'
,
Value
,
1
)
if
(
$second_before
==
$second_after
)
{
--
echo
Too
much
space
are
reserved
on
second
index
.
--
echo
Too
little
space
is
reserved
on
second
index
.
}
DROP
TABLE
t2
;
\ No newline at end of file
DROP
TABLE
t2
;
--
source
include
/
wait_innodb_all_purged
.
inc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment