mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-6354: Implement a way to read MySQL 5.7.4-labs-tplc page
compression format (Fusion-IO). Addeed LZMA and BZIP2 compression methods.
This commit is contained in:
25
cmake/bzip2.cmake
Normal file
25
cmake/bzip2.cmake
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Copyright (C) 2014, SkySQL Ab. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; version 2 of the License.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
MACRO (MYSQL_CHECK_BZIP2)
|
||||||
|
|
||||||
|
CHECK_INCLUDE_FILES(bzlib.h HAVE_BZLIB2_H)
|
||||||
|
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffCompress "" HAVE_BZLIB2_COMPRESS)
|
||||||
|
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS)
|
||||||
|
|
||||||
|
IF (HAVE_BZLIB2_COMPRESS AND HAVE_BZLIB2_DECOMPRESS AND HAVE_BZLIB2_H)
|
||||||
|
ADD_DEFINITIONS(-DHAVE_BZIP2=1)
|
||||||
|
LINK_LIBRARIES(bz2)
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
25
cmake/lzma.cmake
Normal file
25
cmake/lzma.cmake
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Copyright (C) 2014, SkySQL Ab. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; version 2 of the License.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
MACRO (MYSQL_CHECK_LZMA)
|
||||||
|
|
||||||
|
CHECK_INCLUDE_FILES(lzma.h HAVE_LZMA_H)
|
||||||
|
CHECK_LIBRARY_EXISTS(lzma lzma_stream_buffer_decode "" HAVE_LZMA_DECODE)
|
||||||
|
CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE)
|
||||||
|
|
||||||
|
IF (HAVE_LZMA_DECODE AND HAVE_LZMA_ENCODE AND HAVE_LZMA_H)
|
||||||
|
ADD_DEFINITIONS(-DHAVE_LZMA=1)
|
||||||
|
LINK_LIBRARIES(lzma)
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
4
mysql-test/include/have_innodb_bzip2.inc
Normal file
4
mysql-test/include/have_innodb_bzip2.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_bzip2' AND variable_value = 'ON'`)
|
||||||
|
{
|
||||||
|
--skip Test requires InnoDB compiled with libbz2
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lz4' AND variable_value = 1`)
|
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lz4' AND variable_value = 'ON'`)
|
||||||
{
|
{
|
||||||
--skip Test requires InnoDB compiled with liblz4
|
--skip Test requires InnoDB compiled with liblz4
|
||||||
}
|
}
|
||||||
|
4
mysql-test/include/have_innodb_lzma.inc
Normal file
4
mysql-test/include/have_innodb_lzma.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzma' AND variable_value = 'ON' `)
|
||||||
|
{
|
||||||
|
--skip Test requires InnoDB compiled with liblzma
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzo' AND variable_value = 1`)
|
if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzo' AND variable_value = 'ON'`)
|
||||||
{
|
{
|
||||||
--skip Test requires InnoDB compiled with liblzo
|
--skip Test requires InnoDB compiled with liblzo
|
||||||
}
|
}
|
||||||
|
269
mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
Normal file
269
mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
set global innodb_file_format = `barracuda`;
|
||||||
|
set global innodb_file_per_table = on;
|
||||||
|
set global innodb_compression_algorithm = 5;
|
||||||
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed1;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1
|
||||||
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed2;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2
|
||||||
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed3;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3
|
||||||
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed4;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4
|
||||||
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed5;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5
|
||||||
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed6;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6
|
||||||
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed7;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7
|
||||||
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed8;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed9;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9
|
||||||
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
|
begin
|
||||||
|
declare current_num int;
|
||||||
|
set current_num = 0;
|
||||||
|
while current_num < repeat_count do
|
||||||
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
|
set current_num = current_num + 1;
|
||||||
|
end while;
|
||||||
|
end//
|
||||||
|
commit;
|
||||||
|
set autocommit=0;
|
||||||
|
call innodb_insert_proc(5000);
|
||||||
|
commit;
|
||||||
|
set autocommit=1;
|
||||||
|
select count(*) from innodb_normal;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_normal;
|
||||||
|
Table Create Table
|
||||||
|
innodb_normal CREATE TABLE `innodb_normal` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_compressed;
|
||||||
|
Table Create Table
|
||||||
|
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
|
set global innodb_compression_algorithm = 1;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
set global innodb_compression_algorithm = 0;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
drop procedure innodb_insert_proc;
|
||||||
|
drop table innodb_normal;
|
||||||
|
drop table innodb_compressed;
|
||||||
|
drop table innodb_page_compressed1;
|
||||||
|
drop table innodb_page_compressed2;
|
||||||
|
drop table innodb_page_compressed3;
|
||||||
|
drop table innodb_page_compressed4;
|
||||||
|
drop table innodb_page_compressed5;
|
||||||
|
drop table innodb_page_compressed6;
|
||||||
|
drop table innodb_page_compressed7;
|
||||||
|
drop table innodb_page_compressed8;
|
||||||
|
drop table innodb_page_compressed9;
|
@ -1,269 +1,269 @@
|
|||||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
set global innodb_file_format = `barracuda`;
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
set global innodb_file_per_table = on;
|
||||||
SET GLOBAL innodb_compression_algorithm = 2;
|
set global innodb_compression_algorithm = 2;
|
||||||
CREATE TABLE INNODB_COMPRESSED(c1 INT, b char(20)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
CREATE TABLE INNODB_NORMAL (c1 INT, b char(20)) ENGINE=INNODB;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED1 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=1;
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED1;
|
show create table innodb_page_compressed1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED1 CREATE TABLE `INNODB_PAGE_COMPRESSED1` (
|
innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=1
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED2 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=2;
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED2;
|
show create table innodb_page_compressed2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED2 CREATE TABLE `INNODB_PAGE_COMPRESSED2` (
|
innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=2
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED3 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3;
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED3;
|
show create table innodb_page_compressed3;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED3 CREATE TABLE `INNODB_PAGE_COMPRESSED3` (
|
innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=3
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED4 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=4;
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED4;
|
show create table innodb_page_compressed4;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED4 CREATE TABLE `INNODB_PAGE_COMPRESSED4` (
|
innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=4
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED5 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=5;
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED5;
|
show create table innodb_page_compressed5;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED5 CREATE TABLE `INNODB_PAGE_COMPRESSED5` (
|
innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=5
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED6 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=6;
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED6;
|
show create table innodb_page_compressed6;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED6 CREATE TABLE `INNODB_PAGE_COMPRESSED6` (
|
innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=6
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED7 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=7;
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED7;
|
show create table innodb_page_compressed7;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED7 CREATE TABLE `INNODB_PAGE_COMPRESSED7` (
|
innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=7
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED8 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED8;
|
show create table innodb_page_compressed8;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED8 CREATE TABLE `INNODB_PAGE_COMPRESSED8` (
|
innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED9 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED9;
|
show create table innodb_page_compressed9;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED9 CREATE TABLE `INNODB_PAGE_COMPRESSED9` (
|
innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=9
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9
|
||||||
CREATE PROCEDURE INNODB_INSERT_PROC (REPEAT_COUNT INT)
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
BEGIN
|
begin
|
||||||
DECLARE CURRENT_NUM INT;
|
declare current_num int;
|
||||||
SET CURRENT_NUM = 0;
|
set current_num = 0;
|
||||||
WHILE CURRENT_NUM < REPEAT_COUNT DO
|
while current_num < repeat_count do
|
||||||
INSERT INTO INNODB_NORMAL VALUES(CURRENT_NUM,'Testing..');
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
SET CURRENT_NUM = CURRENT_NUM + 1;
|
set current_num = current_num + 1;
|
||||||
END WHILE;
|
end while;
|
||||||
END//
|
end//
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=0;
|
set autocommit=0;
|
||||||
CALL INNODB_INSERT_PROC(5000);
|
call innodb_insert_proc(5000);
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=1;
|
set autocommit=1;
|
||||||
SELECT COUNT(*) FROM INNODB_NORMAL;
|
select count(*) from innodb_normal;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
INSERT INTO INNODB_COMPRESSED SELECT * FROM INNODB_NORMAL;
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED1 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED2 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED3 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED4 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED5 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED6 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED7 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED8 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED9 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
ALTER TABLE INNODB_NORMAL PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_NORMAL;
|
show create table innodb_normal;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_NORMAL CREATE TABLE `INNODB_NORMAL` (
|
innodb_normal CREATE TABLE `innodb_normal` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
ALTER TABLE INNODB_COMPRESSED ROW_FORMAT=DEFAULT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8 KEY_BLOCK_SIZE=0;
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_COMPRESSED;
|
show create table innodb_compressed;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_COMPRESSED CREATE TABLE `INNODB_COMPRESSED` (
|
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
SET GLOBAL innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SET GLOBAL innodb_compression_algorithm = 0;
|
set global innodb_compression_algorithm = 0;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
DROP PROCEDURE INNODB_INSERT_PROC;
|
drop procedure innodb_insert_proc;
|
||||||
DROP TABLE INNODB_NORMAL;
|
drop table innodb_normal;
|
||||||
DROP TABLE INNODB_COMPRESSED;
|
drop table innodb_compressed;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED1;
|
drop table innodb_page_compressed1;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED2;
|
drop table innodb_page_compressed2;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED3;
|
drop table innodb_page_compressed3;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED4;
|
drop table innodb_page_compressed4;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED5;
|
drop table innodb_page_compressed5;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED6;
|
drop table innodb_page_compressed6;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED7;
|
drop table innodb_page_compressed7;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED8;
|
drop table innodb_page_compressed8;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED9;
|
drop table innodb_page_compressed9;
|
||||||
|
269
mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
Normal file
269
mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
set global innodb_file_format = `barracuda`;
|
||||||
|
set global innodb_file_per_table = on;
|
||||||
|
set global innodb_compression_algorithm = 4;
|
||||||
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed1;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1
|
||||||
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed2;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2
|
||||||
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed3;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3
|
||||||
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed4;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4
|
||||||
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed5;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5
|
||||||
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed6;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6
|
||||||
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed7;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7
|
||||||
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed8;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_page_compressed9;
|
||||||
|
Table Create Table
|
||||||
|
innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9
|
||||||
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
|
begin
|
||||||
|
declare current_num int;
|
||||||
|
set current_num = 0;
|
||||||
|
while current_num < repeat_count do
|
||||||
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
|
set current_num = current_num + 1;
|
||||||
|
end while;
|
||||||
|
end//
|
||||||
|
commit;
|
||||||
|
set autocommit=0;
|
||||||
|
call innodb_insert_proc(5000);
|
||||||
|
commit;
|
||||||
|
set autocommit=1;
|
||||||
|
select count(*) from innodb_normal;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_normal;
|
||||||
|
Table Create Table
|
||||||
|
innodb_normal CREATE TABLE `innodb_normal` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
show create table innodb_compressed;
|
||||||
|
Table Create Table
|
||||||
|
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||||
|
`c1` int(11) DEFAULT NULL,
|
||||||
|
`b` char(20) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
|
set global innodb_compression_algorithm = 1;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
set global innodb_compression_algorithm = 0;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
count(*)
|
||||||
|
5000
|
||||||
|
drop procedure innodb_insert_proc;
|
||||||
|
drop table innodb_normal;
|
||||||
|
drop table innodb_compressed;
|
||||||
|
drop table innodb_page_compressed1;
|
||||||
|
drop table innodb_page_compressed2;
|
||||||
|
drop table innodb_page_compressed3;
|
||||||
|
drop table innodb_page_compressed4;
|
||||||
|
drop table innodb_page_compressed5;
|
||||||
|
drop table innodb_page_compressed6;
|
||||||
|
drop table innodb_page_compressed7;
|
||||||
|
drop table innodb_page_compressed8;
|
||||||
|
drop table innodb_page_compressed9;
|
@ -1,269 +1,225 @@
|
|||||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
set global innodb_file_format = `barracuda`;
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
set global innodb_file_per_table = on;
|
||||||
SET GLOBAL innodb_compression_algorithm = 3;
|
set global innodb_compression_algorithm = 3;
|
||||||
CREATE TABLE INNODB_COMPRESSED(c1 INT, b char(20)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
CREATE TABLE INNODB_NORMAL (c1 INT, b char(20)) ENGINE=INNODB;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED1 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=1;
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED1;
|
show create table innodb_page_compressed1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED1 CREATE TABLE `INNODB_PAGE_COMPRESSED1` (
|
innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=1
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED2 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=2;
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED2;
|
show create table innodb_page_compressed2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED2 CREATE TABLE `INNODB_PAGE_COMPRESSED2` (
|
innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=2
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED3 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3;
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED3;
|
show create table innodb_page_compressed3;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED3 CREATE TABLE `INNODB_PAGE_COMPRESSED3` (
|
innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=3
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED4 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=4;
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED4;
|
show create table innodb_page_compressed4;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED4 CREATE TABLE `INNODB_PAGE_COMPRESSED4` (
|
innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=4
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED5 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=5;
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED5;
|
show create table innodb_page_compressed5;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED5 CREATE TABLE `INNODB_PAGE_COMPRESSED5` (
|
innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=5
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED6 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=6;
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED6;
|
show create table innodb_page_compressed6;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED6 CREATE TABLE `INNODB_PAGE_COMPRESSED6` (
|
innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=6
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED7 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=7;
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED7;
|
show create table innodb_page_compressed7;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED7 CREATE TABLE `INNODB_PAGE_COMPRESSED7` (
|
innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=7
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED8 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED8;
|
show create table innodb_page_compressed8;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED8 CREATE TABLE `INNODB_PAGE_COMPRESSED8` (
|
innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED9 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED9;
|
show create table innodb_page_compressed9;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED9 CREATE TABLE `INNODB_PAGE_COMPRESSED9` (
|
innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=9
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9
|
||||||
CREATE PROCEDURE INNODB_INSERT_PROC (REPEAT_COUNT INT)
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
BEGIN
|
begin
|
||||||
DECLARE CURRENT_NUM INT;
|
declare current_num int;
|
||||||
SET CURRENT_NUM = 0;
|
set current_num = 0;
|
||||||
WHILE CURRENT_NUM < REPEAT_COUNT DO
|
while current_num < repeat_count do
|
||||||
INSERT INTO INNODB_NORMAL VALUES(CURRENT_NUM,'Testing..');
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
SET CURRENT_NUM = CURRENT_NUM + 1;
|
set current_num = current_num + 1;
|
||||||
END WHILE;
|
end while;
|
||||||
END//
|
end//
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=0;
|
set autocommit=0;
|
||||||
CALL INNODB_INSERT_PROC(5000);
|
call innodb_insert_proc(5000);
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=1;
|
set autocommit=1;
|
||||||
SELECT COUNT(*) FROM INNODB_NORMAL;
|
select count(*) from innodb_normal;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
INSERT INTO INNODB_COMPRESSED SELECT * FROM INNODB_NORMAL;
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED1 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED2 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED3 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED4 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED5 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED6 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED7 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED8 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED9 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
ALTER TABLE INNODB_NORMAL PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_NORMAL;
|
show create table innodb_normal;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_NORMAL CREATE TABLE `INNODB_NORMAL` (
|
innodb_normal CREATE TABLE `innodb_normal` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
ALTER TABLE INNODB_COMPRESSED ROW_FORMAT=DEFAULT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8 KEY_BLOCK_SIZE=0;
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_COMPRESSED;
|
show create table innodb_compressed;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_COMPRESSED CREATE TABLE `INNODB_COMPRESSED` (
|
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
SET GLOBAL innodb_compression_algorithm = 2;
|
set global innodb_compression_algorithm = 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SET GLOBAL innodb_compression_algorithm = 1;
|
drop procedure innodb_insert_proc;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
drop table innodb_normal;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
drop table innodb_compressed;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
drop table innodb_page_compressed1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
drop table innodb_page_compressed2;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
drop table innodb_page_compressed3;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
drop table innodb_page_compressed4;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
drop table innodb_page_compressed5;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
drop table innodb_page_compressed6;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
drop table innodb_page_compressed7;
|
||||||
COMMIT;
|
drop table innodb_page_compressed8;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
drop table innodb_page_compressed9;
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
|
||||||
COUNT(*)
|
|
||||||
5000
|
|
||||||
DROP PROCEDURE INNODB_INSERT_PROC;
|
|
||||||
DROP TABLE INNODB_NORMAL;
|
|
||||||
DROP TABLE INNODB_COMPRESSED;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED1;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED2;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED3;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED4;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED5;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED6;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED7;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED8;
|
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED9;
|
|
||||||
|
@ -1,225 +1,225 @@
|
|||||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
SET GLOBAL innodb_file_per_table = ON;
|
||||||
SET GLOBAL innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
CREATE TABLE INNODB_COMPRESSED(c1 INT, b char(20)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
CREATE TABLE INNODB_NORMAL (c1 INT, b char(20)) ENGINE=INNODB;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED1 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=1;
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED1;
|
show create table innodb_page_compressed1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED1 CREATE TABLE `INNODB_PAGE_COMPRESSED1` (
|
innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=1
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED2 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=2;
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED2;
|
show create table innodb_page_compressed2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED2 CREATE TABLE `INNODB_PAGE_COMPRESSED2` (
|
innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=2
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED3 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3;
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED3;
|
show create table innodb_page_compressed3;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED3 CREATE TABLE `INNODB_PAGE_COMPRESSED3` (
|
innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=3
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED4 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=4;
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED4;
|
show create table innodb_page_compressed4;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED4 CREATE TABLE `INNODB_PAGE_COMPRESSED4` (
|
innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=4
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED5 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=5;
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED5;
|
show create table innodb_page_compressed5;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED5 CREATE TABLE `INNODB_PAGE_COMPRESSED5` (
|
innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=5
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED6 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=6;
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED6;
|
show create table innodb_page_compressed6;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED6 CREATE TABLE `INNODB_PAGE_COMPRESSED6` (
|
innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=6
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED7 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=7;
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED7;
|
show create table innodb_page_compressed7;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED7 CREATE TABLE `INNODB_PAGE_COMPRESSED7` (
|
innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=7
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED8 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED8;
|
show create table innodb_page_compressed8;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED8 CREATE TABLE `INNODB_PAGE_COMPRESSED8` (
|
innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED9 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED9;
|
show create table innodb_page_compressed9;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_PAGE_COMPRESSED9 CREATE TABLE `INNODB_PAGE_COMPRESSED9` (
|
innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=9
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9
|
||||||
CREATE PROCEDURE INNODB_INSERT_PROC (REPEAT_COUNT INT)
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
BEGIN
|
begin
|
||||||
DECLARE CURRENT_NUM INT;
|
declare current_num int;
|
||||||
SET CURRENT_NUM = 0;
|
set current_num = 0;
|
||||||
WHILE CURRENT_NUM < REPEAT_COUNT DO
|
while current_num < repeat_count do
|
||||||
INSERT INTO INNODB_NORMAL VALUES(CURRENT_NUM,'Testing..');
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
SET CURRENT_NUM = CURRENT_NUM + 1;
|
set current_num = current_num + 1;
|
||||||
END WHILE;
|
end while;
|
||||||
END//
|
end//
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=0;
|
set autocommit=0;
|
||||||
CALL INNODB_INSERT_PROC(5000);
|
call innodb_insert_proc(5000);
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=1;
|
set autocommit=1;
|
||||||
SELECT COUNT(*) FROM INNODB_NORMAL;
|
select count(*) from innodb_normal;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
INSERT INTO INNODB_COMPRESSED SELECT * FROM INNODB_NORMAL;
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED1 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED2 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED3 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED4 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED5 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED6 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED7 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED8 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED9 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
ALTER TABLE INNODB_NORMAL PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_NORMAL;
|
show create table innodb_normal;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_NORMAL CREATE TABLE `INNODB_NORMAL` (
|
innodb_normal CREATE TABLE `innodb_normal` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
ALTER TABLE INNODB_COMPRESSED ROW_FORMAT=DEFAULT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8 KEY_BLOCK_SIZE=0;
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
SHOW CREATE TABLE INNODB_COMPRESSED;
|
show create table innodb_compressed;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
INNODB_COMPRESSED CREATE TABLE `INNODB_COMPRESSED` (
|
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||||
`c1` int(11) DEFAULT NULL,
|
`c1` int(11) DEFAULT NULL,
|
||||||
`b` char(20) DEFAULT NULL
|
`b` char(20) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
|
||||||
SET GLOBAL innodb_compression_algorithm = 0;
|
set global innodb_compression_algorithm = 0;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
COUNT(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
DROP PROCEDURE INNODB_INSERT_PROC;
|
drop procedure innodb_insert_proc;
|
||||||
DROP TABLE INNODB_NORMAL;
|
drop table innodb_normal;
|
||||||
DROP TABLE INNODB_COMPRESSED;
|
drop table innodb_compressed;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED1;
|
drop table innodb_page_compressed1;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED2;
|
drop table innodb_page_compressed2;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED3;
|
drop table innodb_page_compressed3;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED4;
|
drop table innodb_page_compressed4;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED5;
|
drop table innodb_page_compressed5;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED6;
|
drop table innodb_page_compressed6;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED7;
|
drop table innodb_page_compressed7;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED8;
|
drop table innodb_page_compressed8;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED9;
|
drop table innodb_page_compressed9;
|
||||||
|
161
mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
Normal file
161
mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
-- source include/have_innodb.inc
|
||||||
|
-- source include/have_innodb_bzip2.inc
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`;
|
||||||
|
let $innodb_file_format_orig = `select @@innodb_file_format`;
|
||||||
|
let $innodb_file_per_table_orig = `select @@innodb_file_per_table`;
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
|
set global innodb_file_format = `barracuda`;
|
||||||
|
set global innodb_file_per_table = on;
|
||||||
|
|
||||||
|
# bzip2
|
||||||
|
set global innodb_compression_algorithm = 5;
|
||||||
|
|
||||||
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
|
show warnings;
|
||||||
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
|
show warnings;
|
||||||
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed1;
|
||||||
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed2;
|
||||||
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed3;
|
||||||
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed4;
|
||||||
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed5;
|
||||||
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed6;
|
||||||
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed7;
|
||||||
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed8;
|
||||||
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed9;
|
||||||
|
delimiter //;
|
||||||
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
|
begin
|
||||||
|
declare current_num int;
|
||||||
|
set current_num = 0;
|
||||||
|
while current_num < repeat_count do
|
||||||
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
|
set current_num = current_num + 1;
|
||||||
|
end while;
|
||||||
|
end//
|
||||||
|
delimiter ;//
|
||||||
|
commit;
|
||||||
|
|
||||||
|
set autocommit=0;
|
||||||
|
call innodb_insert_proc(5000);
|
||||||
|
commit;
|
||||||
|
set autocommit=1;
|
||||||
|
select count(*) from innodb_normal;
|
||||||
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_normal;
|
||||||
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_compressed;
|
||||||
|
|
||||||
|
# zlib
|
||||||
|
set global innodb_compression_algorithm = 1;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
|
# none
|
||||||
|
set global innodb_compression_algorithm = 0;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
|
drop procedure innodb_insert_proc;
|
||||||
|
drop table innodb_normal;
|
||||||
|
drop table innodb_compressed;
|
||||||
|
drop table innodb_page_compressed1;
|
||||||
|
drop table innodb_page_compressed2;
|
||||||
|
drop table innodb_page_compressed3;
|
||||||
|
drop table innodb_page_compressed4;
|
||||||
|
drop table innodb_page_compressed5;
|
||||||
|
drop table innodb_page_compressed6;
|
||||||
|
drop table innodb_page_compressed7;
|
||||||
|
drop table innodb_page_compressed8;
|
||||||
|
drop table innodb_page_compressed9;
|
||||||
|
|
||||||
|
# reset system
|
||||||
|
--disable_query_log
|
||||||
|
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
|
||||||
|
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
||||||
|
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
|
||||||
|
--enable_query_log
|
@ -7,152 +7,152 @@ let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
|||||||
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
set global innodb_file_format = `barracuda`;
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
set global innodb_file_per_table = on;
|
||||||
|
|
||||||
# LZ4
|
# lz4
|
||||||
SET GLOBAL innodb_compression_algorithm = 2;
|
set global innodb_compression_algorithm = 2;
|
||||||
|
|
||||||
CREATE TABLE INNODB_COMPRESSED(c1 INT, b char(20)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
CREATE TABLE INNODB_NORMAL (c1 INT, b char(20)) ENGINE=INNODB;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED1 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=1;
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED1;
|
show create table innodb_page_compressed1;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED2 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=2;
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED2;
|
show create table innodb_page_compressed2;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED3 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3;
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED3;
|
show create table innodb_page_compressed3;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED4 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=4;
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED4;
|
show create table innodb_page_compressed4;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED5 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=5;
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED5;
|
show create table innodb_page_compressed5;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED6 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=6;
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED6;
|
show create table innodb_page_compressed6;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED7 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=7;
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED7;
|
show create table innodb_page_compressed7;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED8 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED8;
|
show create table innodb_page_compressed8;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED9 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED9;
|
show create table innodb_page_compressed9;
|
||||||
DELIMITER //;
|
delimiter //;
|
||||||
CREATE PROCEDURE INNODB_INSERT_PROC (REPEAT_COUNT INT)
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
BEGIN
|
begin
|
||||||
DECLARE CURRENT_NUM INT;
|
declare current_num int;
|
||||||
SET CURRENT_NUM = 0;
|
set current_num = 0;
|
||||||
WHILE CURRENT_NUM < REPEAT_COUNT DO
|
while current_num < repeat_count do
|
||||||
INSERT INTO INNODB_NORMAL VALUES(CURRENT_NUM,'Testing..');
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
SET CURRENT_NUM = CURRENT_NUM + 1;
|
set current_num = current_num + 1;
|
||||||
END WHILE;
|
end while;
|
||||||
END//
|
end//
|
||||||
DELIMITER ;//
|
delimiter ;//
|
||||||
COMMIT;
|
commit;
|
||||||
|
|
||||||
SET AUTOCOMMIT=0;
|
set autocommit=0;
|
||||||
CALL INNODB_INSERT_PROC(5000);
|
call innodb_insert_proc(5000);
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=1;
|
set autocommit=1;
|
||||||
SELECT COUNT(*) FROM INNODB_NORMAL;
|
select count(*) from innodb_normal;
|
||||||
INSERT INTO INNODB_COMPRESSED SELECT * FROM INNODB_NORMAL;
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED1 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED2 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED3 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED4 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED5 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED6 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED7 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED8 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED9 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
ALTER TABLE INNODB_NORMAL PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_NORMAL;
|
show create table innodb_normal;
|
||||||
ALTER TABLE INNODB_COMPRESSED ROW_FORMAT=DEFAULT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8 KEY_BLOCK_SIZE=0;
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_COMPRESSED;
|
show create table innodb_compressed;
|
||||||
|
|
||||||
|
|
||||||
# ZLIB
|
# zlib
|
||||||
SET GLOBAL innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
# NONE
|
# none
|
||||||
SET GLOBAL innodb_compression_algorithm = 0;
|
set global innodb_compression_algorithm = 0;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
DROP PROCEDURE INNODB_INSERT_PROC;
|
drop procedure innodb_insert_proc;
|
||||||
DROP TABLE INNODB_NORMAL;
|
drop table innodb_normal;
|
||||||
DROP TABLE INNODB_COMPRESSED;
|
drop table innodb_compressed;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED1;
|
drop table innodb_page_compressed1;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED2;
|
drop table innodb_page_compressed2;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED3;
|
drop table innodb_page_compressed3;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED4;
|
drop table innodb_page_compressed4;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED5;
|
drop table innodb_page_compressed5;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED6;
|
drop table innodb_page_compressed6;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED7;
|
drop table innodb_page_compressed7;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED8;
|
drop table innodb_page_compressed8;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED9;
|
drop table innodb_page_compressed9;
|
||||||
|
|
||||||
# reset system
|
# reset system
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
|
162
mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
Normal file
162
mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
-- source include/have_innodb.inc
|
||||||
|
-- source include/have_innodb_lzma.inc
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
|
||||||
|
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
||||||
|
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
|
set global innodb_file_format = `barracuda`;
|
||||||
|
set global innodb_file_per_table = on;
|
||||||
|
|
||||||
|
# lzma
|
||||||
|
set global innodb_compression_algorithm = 4;
|
||||||
|
|
||||||
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
|
show warnings;
|
||||||
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
|
show warnings;
|
||||||
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed1;
|
||||||
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed2;
|
||||||
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed3;
|
||||||
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed4;
|
||||||
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed5;
|
||||||
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed6;
|
||||||
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed7;
|
||||||
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed8;
|
||||||
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_page_compressed9;
|
||||||
|
delimiter //;
|
||||||
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
|
begin
|
||||||
|
declare current_num int;
|
||||||
|
set current_num = 0;
|
||||||
|
while current_num < repeat_count do
|
||||||
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
|
set current_num = current_num + 1;
|
||||||
|
end while;
|
||||||
|
end//
|
||||||
|
delimiter ;//
|
||||||
|
commit;
|
||||||
|
|
||||||
|
set autocommit=0;
|
||||||
|
call innodb_insert_proc(5000);
|
||||||
|
commit;
|
||||||
|
set autocommit=1;
|
||||||
|
select count(*) from innodb_normal;
|
||||||
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_normal;
|
||||||
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
|
show warnings;
|
||||||
|
show create table innodb_compressed;
|
||||||
|
|
||||||
|
|
||||||
|
# zlib
|
||||||
|
set global innodb_compression_algorithm = 1;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
|
# none
|
||||||
|
set global innodb_compression_algorithm = 0;
|
||||||
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
|
commit;
|
||||||
|
select count(*) from innodb_compressed;
|
||||||
|
select count(*) from innodb_page_compressed1;
|
||||||
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
|
drop procedure innodb_insert_proc;
|
||||||
|
drop table innodb_normal;
|
||||||
|
drop table innodb_compressed;
|
||||||
|
drop table innodb_page_compressed1;
|
||||||
|
drop table innodb_page_compressed2;
|
||||||
|
drop table innodb_page_compressed3;
|
||||||
|
drop table innodb_page_compressed4;
|
||||||
|
drop table innodb_page_compressed5;
|
||||||
|
drop table innodb_page_compressed6;
|
||||||
|
drop table innodb_page_compressed7;
|
||||||
|
drop table innodb_page_compressed8;
|
||||||
|
drop table innodb_page_compressed9;
|
||||||
|
|
||||||
|
# reset system
|
||||||
|
--disable_query_log
|
||||||
|
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
|
||||||
|
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
||||||
|
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
|
||||||
|
--enable_query_log
|
@ -1,163 +1,137 @@
|
|||||||
-- source include/have_innodb.inc
|
-- source include/have_innodb.inc
|
||||||
-- source include/have_innodb_lzo.inc
|
-- source include/have_innodb_lzo.inc
|
||||||
-- source include/have_innodb_lz4.inc
|
|
||||||
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
|
let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`;
|
||||||
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
let $innodb_file_format_orig = `select @@innodb_file_format`;
|
||||||
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
let $innodb_file_per_table_orig = `select @@innodb_file_per_table`;
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
set global innodb_file_format = `barracuda`;
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
set global innodb_file_per_table = on;
|
||||||
|
|
||||||
# LZO
|
# lzo
|
||||||
SET GLOBAL innodb_compression_algorithm = 3;
|
set global innodb_compression_algorithm = 3;
|
||||||
|
|
||||||
CREATE TABLE INNODB_COMPRESSED(c1 INT, b char(20)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
CREATE TABLE INNODB_NORMAL (c1 INT, b char(20)) ENGINE=INNODB;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED1 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=1;
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED1;
|
show create table innodb_page_compressed1;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED2 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=2;
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED2;
|
show create table innodb_page_compressed2;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED3 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3;
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED3;
|
show create table innodb_page_compressed3;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED4 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=4;
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED4;
|
show create table innodb_page_compressed4;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED5 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=5;
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED5;
|
show create table innodb_page_compressed5;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED6 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=6;
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED6;
|
show create table innodb_page_compressed6;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED7 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=7;
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED7;
|
show create table innodb_page_compressed7;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED8 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED8;
|
show create table innodb_page_compressed8;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED9 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED9;
|
show create table innodb_page_compressed9;
|
||||||
DELIMITER //;
|
delimiter //;
|
||||||
CREATE PROCEDURE INNODB_INSERT_PROC (REPEAT_COUNT INT)
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
BEGIN
|
begin
|
||||||
DECLARE CURRENT_NUM INT;
|
declare current_num int;
|
||||||
SET CURRENT_NUM = 0;
|
set current_num = 0;
|
||||||
WHILE CURRENT_NUM < REPEAT_COUNT DO
|
while current_num < repeat_count do
|
||||||
INSERT INTO INNODB_NORMAL VALUES(CURRENT_NUM,'Testing..');
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
SET CURRENT_NUM = CURRENT_NUM + 1;
|
set current_num = current_num + 1;
|
||||||
END WHILE;
|
end while;
|
||||||
END//
|
end//
|
||||||
DELIMITER ;//
|
delimiter ;//
|
||||||
COMMIT;
|
commit;
|
||||||
|
|
||||||
SET AUTOCOMMIT=0;
|
set autocommit=0;
|
||||||
CALL INNODB_INSERT_PROC(5000);
|
call innodb_insert_proc(5000);
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=1;
|
set autocommit=1;
|
||||||
SELECT COUNT(*) FROM INNODB_NORMAL;
|
select count(*) from innodb_normal;
|
||||||
INSERT INTO INNODB_COMPRESSED SELECT * FROM INNODB_NORMAL;
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED1 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED2 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED3 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED4 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED5 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED6 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED7 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED8 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED9 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
ALTER TABLE INNODB_NORMAL PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_NORMAL;
|
show create table innodb_normal;
|
||||||
ALTER TABLE INNODB_COMPRESSED ROW_FORMAT=DEFAULT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8 KEY_BLOCK_SIZE=0;
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_COMPRESSED;
|
show create table innodb_compressed;
|
||||||
|
|
||||||
|
|
||||||
# LZ4
|
|
||||||
SET GLOBAL innodb_compression_algorithm = 2;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
|
||||||
COMMIT;
|
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
|
||||||
|
|
||||||
# zlib
|
# zlib
|
||||||
SET GLOBAL innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
DROP PROCEDURE INNODB_INSERT_PROC;
|
drop procedure innodb_insert_proc;
|
||||||
DROP TABLE INNODB_NORMAL;
|
drop table innodb_normal;
|
||||||
DROP TABLE INNODB_COMPRESSED;
|
drop table innodb_compressed;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED1;
|
drop table innodb_page_compressed1;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED2;
|
drop table innodb_page_compressed2;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED3;
|
drop table innodb_page_compressed3;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED4;
|
drop table innodb_page_compressed4;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED5;
|
drop table innodb_page_compressed5;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED6;
|
drop table innodb_page_compressed6;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED7;
|
drop table innodb_page_compressed7;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED8;
|
drop table innodb_page_compressed8;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED9;
|
drop table innodb_page_compressed9;
|
||||||
|
|
||||||
# reset system
|
# reset system
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
|
eval set global innodb_compression_algorithm = $innodb_compression_algorithm_orig;
|
||||||
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
eval set global innodb_file_per_table = $innodb_file_per_table_orig;
|
||||||
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
|
eval set global innodb_file_format = $innodb_file_format_orig;
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
@ -9,125 +9,125 @@ let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
|||||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
SET GLOBAL innodb_file_per_table = ON;
|
||||||
|
|
||||||
# ZLIB
|
# zlib
|
||||||
SET GLOBAL innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
|
|
||||||
CREATE TABLE INNODB_COMPRESSED(c1 INT, b char(20)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
CREATE TABLE INNODB_NORMAL (c1 INT, b char(20)) ENGINE=INNODB;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED1 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=1;
|
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED1;
|
show create table innodb_page_compressed1;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED2 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=2;
|
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED2;
|
show create table innodb_page_compressed2;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED3 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3;
|
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED3;
|
show create table innodb_page_compressed3;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED4 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=4;
|
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED4;
|
show create table innodb_page_compressed4;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED5 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=5;
|
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED5;
|
show create table innodb_page_compressed5;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED6 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=6;
|
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED6;
|
show create table innodb_page_compressed6;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED7 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=7;
|
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED7;
|
show create table innodb_page_compressed7;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED8 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED8;
|
show create table innodb_page_compressed8;
|
||||||
CREATE TABLE INNODB_PAGE_COMPRESSED9 (c1 INT, b char(20)) ENGINE=INNODB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_PAGE_COMPRESSED9;
|
show create table innodb_page_compressed9;
|
||||||
DELIMITER //;
|
delimiter //;
|
||||||
CREATE PROCEDURE INNODB_INSERT_PROC (REPEAT_COUNT INT)
|
create procedure innodb_insert_proc (repeat_count int)
|
||||||
BEGIN
|
begin
|
||||||
DECLARE CURRENT_NUM INT;
|
declare current_num int;
|
||||||
SET CURRENT_NUM = 0;
|
set current_num = 0;
|
||||||
WHILE CURRENT_NUM < REPEAT_COUNT DO
|
while current_num < repeat_count do
|
||||||
INSERT INTO INNODB_NORMAL VALUES(CURRENT_NUM,'Testing..');
|
insert into innodb_normal values(current_num,'testing..');
|
||||||
SET CURRENT_NUM = CURRENT_NUM + 1;
|
set current_num = current_num + 1;
|
||||||
END WHILE;
|
end while;
|
||||||
END//
|
end//
|
||||||
DELIMITER ;//
|
delimiter ;//
|
||||||
COMMIT;
|
commit;
|
||||||
|
|
||||||
SET AUTOCOMMIT=0;
|
set autocommit=0;
|
||||||
CALL INNODB_INSERT_PROC(5000);
|
call innodb_insert_proc(5000);
|
||||||
COMMIT;
|
commit;
|
||||||
SET AUTOCOMMIT=1;
|
set autocommit=1;
|
||||||
SELECT COUNT(*) FROM INNODB_NORMAL;
|
select count(*) from innodb_normal;
|
||||||
INSERT INTO INNODB_COMPRESSED SELECT * FROM INNODB_NORMAL;
|
insert into innodb_compressed select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED1 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed1 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED2 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed2 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED3 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed3 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED4 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed4 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED5 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed5 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED6 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed6 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED7 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed7 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED8 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed8 select * from innodb_normal;
|
||||||
INSERT INTO INNODB_PAGE_COMPRESSED9 SELECT * FROM INNODB_NORMAL;
|
insert into innodb_page_compressed9 select * from innodb_normal;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
ALTER TABLE INNODB_NORMAL PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8;
|
alter table innodb_normal page_compressed=1 page_compression_level=8;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_NORMAL;
|
show create table innodb_normal;
|
||||||
ALTER TABLE INNODB_COMPRESSED ROW_FORMAT=DEFAULT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=8 KEY_BLOCK_SIZE=0;
|
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
|
||||||
SHOW WARNINGS;
|
show warnings;
|
||||||
SHOW CREATE TABLE INNODB_COMPRESSED;
|
show create table innodb_compressed;
|
||||||
|
|
||||||
|
|
||||||
# NONE
|
# none
|
||||||
SET GLOBAL innodb_compression_algorithm = 0;
|
set global innodb_compression_algorithm = 0;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED1 SET c1 = c1 + 1;
|
update innodb_page_compressed1 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED2 SET c1 = c1 + 1;
|
update innodb_page_compressed2 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED3 SET c1 = c1 + 1;
|
update innodb_page_compressed3 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED4 SET c1 = c1 + 1;
|
update innodb_page_compressed4 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED5 SET c1 = c1 + 1;
|
update innodb_page_compressed5 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED6 SET c1 = c1 + 1;
|
update innodb_page_compressed6 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED7 SET c1 = c1 + 1;
|
update innodb_page_compressed7 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED8 SET c1 = c1 + 1;
|
update innodb_page_compressed8 set c1 = c1 + 1;
|
||||||
UPDATE INNODB_PAGE_COMPRESSED9 SET c1 = c1 + 1;
|
update innodb_page_compressed9 set c1 = c1 + 1;
|
||||||
COMMIT;
|
commit;
|
||||||
SELECT COUNT(*) FROM INNODB_COMPRESSED;
|
select count(*) from innodb_compressed;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1;
|
select count(*) from innodb_page_compressed1;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED1 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed1 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED2 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed2 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED3 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed3 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED4 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed4 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED5 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed5 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED6 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed6 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED7 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed7 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED8 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed8 where c1 < 500000;
|
||||||
SELECT COUNT(*) FROM INNODB_PAGE_COMPRESSED9 WHERE C1 < 500000;
|
select count(*) from innodb_page_compressed9 where c1 < 500000;
|
||||||
|
|
||||||
DROP PROCEDURE INNODB_INSERT_PROC;
|
drop procedure innodb_insert_proc;
|
||||||
DROP TABLE INNODB_NORMAL;
|
drop table innodb_normal;
|
||||||
DROP TABLE INNODB_COMPRESSED;
|
drop table innodb_compressed;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED1;
|
drop table innodb_page_compressed1;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED2;
|
drop table innodb_page_compressed2;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED3;
|
drop table innodb_page_compressed3;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED4;
|
drop table innodb_page_compressed4;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED5;
|
drop table innodb_page_compressed5;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED6;
|
drop table innodb_page_compressed6;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED7;
|
drop table innodb_page_compressed7;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED8;
|
drop table innodb_page_compressed8;
|
||||||
DROP TABLE INNODB_PAGE_COMPRESSED9;
|
drop table innodb_page_compressed9;
|
||||||
|
|
||||||
# reset system
|
# reset system
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
|
@ -20,9 +20,13 @@ INCLUDE(CheckCSourceCompiles)
|
|||||||
INCLUDE(CheckCSourceRuns)
|
INCLUDE(CheckCSourceRuns)
|
||||||
INCLUDE(lz4)
|
INCLUDE(lz4)
|
||||||
INCLUDE(lzo)
|
INCLUDE(lzo)
|
||||||
|
INCLUDE(lzma)
|
||||||
|
INCLUDE(bzip2)
|
||||||
|
|
||||||
MYSQL_CHECK_LZ4()
|
MYSQL_CHECK_LZ4()
|
||||||
MYSQL_CHECK_LZO()
|
MYSQL_CHECK_LZO()
|
||||||
|
MYSQL_CHECK_LZMA()
|
||||||
|
MYSQL_CHECK_BZIP2()
|
||||||
|
|
||||||
# OS tests
|
# OS tests
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
|
@ -68,10 +68,184 @@ static ulint srv_data_read, srv_data_written;
|
|||||||
#ifdef HAVE_LZO
|
#ifdef HAVE_LZO
|
||||||
#include "lzo/lzo1x.h"
|
#include "lzo/lzo1x.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
#include "lzma.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
#include "bzlib.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Used for debugging */
|
/* Used for debugging */
|
||||||
//#define UNIV_PAGECOMPRESS_DEBUG 1
|
//#define UNIV_PAGECOMPRESS_DEBUG 1
|
||||||
|
|
||||||
|
/****************************************************************//**
|
||||||
|
For page compressed pages decompress the page after actual read
|
||||||
|
operation. */
|
||||||
|
static
|
||||||
|
void
|
||||||
|
fil_decompress_page_2(
|
||||||
|
/*==================*/
|
||||||
|
byte* page_buf, /*!< out: destination buffer for
|
||||||
|
uncompressed data */
|
||||||
|
byte* buf, /*!< in: source compressed data */
|
||||||
|
ulong len, /*!< in: length of output buffer.*/
|
||||||
|
ulint* write_size) /*!< in/out: Actual payload size of
|
||||||
|
the compressed data. */
|
||||||
|
{
|
||||||
|
ulint page_type = mach_read_from_2(buf + FIL_PAGE_TYPE);
|
||||||
|
|
||||||
|
if (page_type != FIL_PAGE_COMPRESSED) {
|
||||||
|
/* It is not a compressed page */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulint olen = 0;
|
||||||
|
byte* ptr = buf + FIL_PAGE_DATA;
|
||||||
|
ulint version = mach_read_from_1(buf + FIL_PAGE_VERSION);
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
ut_a(version == 1);
|
||||||
|
|
||||||
|
/* Read the original page type, before we compressed the data. */
|
||||||
|
page_type = mach_read_from_2(buf + FIL_PAGE_ORIGINAL_TYPE_V1);
|
||||||
|
|
||||||
|
ulint original_len = mach_read_from_2(buf + FIL_PAGE_ORIGINAL_SIZE_V1);
|
||||||
|
|
||||||
|
if (original_len < UNIV_PAGE_SIZE_MIN - (FIL_PAGE_DATA + 8)
|
||||||
|
|| original_len > UNIV_PAGE_SIZE_MAX - FIL_PAGE_DATA
|
||||||
|
|| len < original_len + FIL_PAGE_DATA) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: We try to uncompress corrupted page\n"
|
||||||
|
"InnoDB: Original len %lu len %lu.\n",
|
||||||
|
original_len, len);
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
ut_error;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ulint algorithm = mach_read_from_1(buf + FIL_PAGE_ALGORITHM_V1);
|
||||||
|
|
||||||
|
switch(algorithm) {
|
||||||
|
case PAGE_ZLIB_ALGORITHM: {
|
||||||
|
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: zlib\n");
|
||||||
|
|
||||||
|
err = uncompress(page_buf, &len, ptr, original_len);
|
||||||
|
/* If uncompress fails it means that page is corrupted */
|
||||||
|
if (err != Z_OK) {
|
||||||
|
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but uncompress failed with error %d.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
err, original_len, len);
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#ifdef HAVE_LZ4
|
||||||
|
case PAGE_LZ4_ALGORITHM: {
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: lz4\n");
|
||||||
|
err = LZ4_decompress_fast(
|
||||||
|
(const char*) ptr, (char*) (page_buf), original_len);
|
||||||
|
|
||||||
|
if (err < 0) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %d bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
err, original_len, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZ4 */
|
||||||
|
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
case PAGE_LZMA_ALGORITHM: {
|
||||||
|
|
||||||
|
lzma_ret ret;
|
||||||
|
size_t src_pos = 0;
|
||||||
|
size_t dst_pos = 0;
|
||||||
|
uint64_t memlimit = UINT64_MAX;
|
||||||
|
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: lzma\n");
|
||||||
|
ret = lzma_stream_buffer_decode(
|
||||||
|
&memlimit,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
ptr,
|
||||||
|
&src_pos,
|
||||||
|
original_len,
|
||||||
|
(page_buf),
|
||||||
|
&dst_pos,
|
||||||
|
len);
|
||||||
|
|
||||||
|
|
||||||
|
if (ret != LZMA_OK || (dst_pos <= 0 || dst_pos > len)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %ld bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
dst_pos, original_len, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZMA */
|
||||||
|
|
||||||
|
#ifdef HAVE_LZO
|
||||||
|
case PAGE_LZO_ALGORITHM: {
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: lzo \n");
|
||||||
|
err = lzo1x_decompress((const unsigned char *)ptr,
|
||||||
|
original_len,(unsigned char *)(page_buf), &olen, NULL);
|
||||||
|
|
||||||
|
if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %ld bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
olen, original_len, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZO */
|
||||||
|
|
||||||
|
default:
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but compression algorithm %s\n"
|
||||||
|
"InnoDB: is not known.\n"
|
||||||
|
,fil_get_compression_alg_name(algorithm));
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
ut_error;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Leave the header alone */
|
||||||
|
memmove(buf+FIL_PAGE_DATA, page_buf, original_len);
|
||||||
|
|
||||||
|
mach_write_to_2(buf + FIL_PAGE_TYPE, page_type);
|
||||||
|
|
||||||
|
ut_ad(memcmp(buf + FIL_PAGE_LSN + 4,
|
||||||
|
buf + (original_len + FIL_PAGE_DATA)
|
||||||
|
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************//**
|
/****************************************************************//**
|
||||||
For page compressed pages compress the page before actual write
|
For page compressed pages compress the page before actual write
|
||||||
operation.
|
operation.
|
||||||
@ -157,6 +331,50 @@ fil_compress_page(
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
#endif /* HAVE_LZO */
|
#endif /* HAVE_LZO */
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
case PAGE_LZMA_ALGORITHM: {
|
||||||
|
size_t out_pos=0;
|
||||||
|
|
||||||
|
err = lzma_easy_buffer_encode(
|
||||||
|
compression_level,
|
||||||
|
LZMA_CHECK_NONE,
|
||||||
|
NULL, /* No custom allocator, use malloc/free */
|
||||||
|
reinterpret_cast<uint8_t*>(buf),
|
||||||
|
len,
|
||||||
|
reinterpret_cast<uint8_t*>(out_buf + header_len),
|
||||||
|
&out_pos,
|
||||||
|
(size_t)&write_size);
|
||||||
|
|
||||||
|
if (err != LZMA_OK || write_size > UNIV_PAGE_SIZE-header_len) {
|
||||||
|
srv_stats.pages_page_compression_error.inc();
|
||||||
|
*out_len = len;
|
||||||
|
return (buf);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZMA */
|
||||||
|
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
case PAGE_BZIP2_ALGORITHM: {
|
||||||
|
|
||||||
|
err = BZ2_bzBuffToBuffCompress(
|
||||||
|
(char *)(out_buf + header_len),
|
||||||
|
(unsigned int *)&write_size,
|
||||||
|
(char *)buf,
|
||||||
|
len,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
|
||||||
|
if (err != BZ_OK || write_size > UNIV_PAGE_SIZE-header_len) {
|
||||||
|
srv_stats.pages_page_compression_error.inc();
|
||||||
|
*out_len = len;
|
||||||
|
return (buf);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_BZIP2 */
|
||||||
|
|
||||||
case PAGE_ZLIB_ALGORITHM:
|
case PAGE_ZLIB_ALGORITHM:
|
||||||
err = compress2(out_buf+header_len, (ulong*)&write_size, buf, len, level);
|
err = compress2(out_buf+header_len, (ulong*)&write_size, buf, len, level);
|
||||||
|
|
||||||
@ -245,10 +463,39 @@ fil_decompress_page(
|
|||||||
ulint compression_alg = 0;
|
ulint compression_alg = 0;
|
||||||
byte *in_buf;
|
byte *in_buf;
|
||||||
ulint olen=0;
|
ulint olen=0;
|
||||||
|
ulint ptype;
|
||||||
|
|
||||||
ut_ad(buf);
|
ut_ad(buf);
|
||||||
ut_ad(len);
|
ut_ad(len);
|
||||||
|
|
||||||
|
ptype = mach_read_from_2(buf+FIL_PAGE_TYPE);
|
||||||
|
|
||||||
|
/* Do not try to uncompressed pages that are not compressed */
|
||||||
|
if (ptype != FIL_PAGE_PAGE_COMPRESSED && ptype != FIL_PAGE_COMPRESSED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If no buffer was given, we need to allocate temporal buffer
|
||||||
|
if (page_buf == NULL) {
|
||||||
|
#ifdef UNIV_PAGECOMPRESS_DEBUG
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Note: FIL: Compression buffer not given, allocating...\n");
|
||||||
|
#endif /* UNIV_PAGECOMPRESS_DEBUG */
|
||||||
|
in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE));
|
||||||
|
} else {
|
||||||
|
in_buf = page_buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ptype == FIL_PAGE_COMPRESSED) {
|
||||||
|
|
||||||
|
fil_decompress_page_2(in_buf, buf, len, write_size);
|
||||||
|
// Need to free temporal buffer if no buffer was given
|
||||||
|
if (page_buf == NULL) {
|
||||||
|
ut_free(in_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Before actual decompress, make sure that page type is correct */
|
/* Before actual decompress, make sure that page type is correct */
|
||||||
|
|
||||||
if (mach_read_from_4(buf+FIL_PAGE_SPACE_OR_CHKSUM) != BUF_NO_CHECKSUM_MAGIC ||
|
if (mach_read_from_4(buf+FIL_PAGE_SPACE_OR_CHKSUM) != BUF_NO_CHECKSUM_MAGIC ||
|
||||||
@ -267,17 +514,6 @@ fil_decompress_page(
|
|||||||
/* Get compression algorithm */
|
/* Get compression algorithm */
|
||||||
compression_alg = mach_read_from_8(buf+FIL_PAGE_FILE_FLUSH_LSN);
|
compression_alg = mach_read_from_8(buf+FIL_PAGE_FILE_FLUSH_LSN);
|
||||||
|
|
||||||
// If no buffer was given, we need to allocate temporal buffer
|
|
||||||
if (page_buf == NULL) {
|
|
||||||
#ifdef UNIV_PAGECOMPRESS_DEBUG
|
|
||||||
fprintf(stderr,
|
|
||||||
"InnoDB: Note: FIL: Compression buffer not given, allocating...\n");
|
|
||||||
#endif /* UNIV_PAGECOMPRESS_DEBUG */
|
|
||||||
in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE));
|
|
||||||
} else {
|
|
||||||
in_buf = page_buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the actual size of compressed page */
|
/* Get the actual size of compressed page */
|
||||||
actual_size = mach_read_from_2(buf+FIL_PAGE_DATA);
|
actual_size = mach_read_from_2(buf+FIL_PAGE_DATA);
|
||||||
/* Check if payload size is corrupted */
|
/* Check if payload size is corrupted */
|
||||||
@ -324,7 +560,7 @@ fil_decompress_page(
|
|||||||
|
|
||||||
#ifdef HAVE_LZ4
|
#ifdef HAVE_LZ4
|
||||||
case PAGE_LZ4_ALGORITHM:
|
case PAGE_LZ4_ALGORITHM:
|
||||||
err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, UNIV_PAGE_SIZE);
|
err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, len);
|
||||||
|
|
||||||
if (err != (int)actual_size) {
|
if (err != (int)actual_size) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@ -354,7 +590,67 @@ fil_decompress_page(
|
|||||||
ut_error;
|
ut_error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif /* HAVE_LZO */
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
case PAGE_LZMA_ALGORITHM: {
|
||||||
|
|
||||||
|
lzma_ret ret;
|
||||||
|
size_t src_pos = 0;
|
||||||
|
size_t dst_pos = 0;
|
||||||
|
uint64_t memlimit = UINT64_MAX;
|
||||||
|
|
||||||
|
ret = lzma_stream_buffer_decode(
|
||||||
|
&memlimit,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE,
|
||||||
|
&src_pos,
|
||||||
|
actual_size,
|
||||||
|
in_buf,
|
||||||
|
&dst_pos,
|
||||||
|
len);
|
||||||
|
|
||||||
|
|
||||||
|
if (ret != LZMA_OK || (dst_pos == 0 || dst_pos > UNIV_PAGE_SIZE)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %ld bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
olen, actual_size, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZMA */
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
case PAGE_BZIP2_ALGORITHM: {
|
||||||
|
unsigned int dst_pos = UNIV_PAGE_SIZE;
|
||||||
|
|
||||||
|
err = BZ2_bzBuffToBuffDecompress(
|
||||||
|
(char *)in_buf,
|
||||||
|
&dst_pos,
|
||||||
|
(char *)(buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE),
|
||||||
|
actual_size,
|
||||||
|
1,
|
||||||
|
0);
|
||||||
|
|
||||||
|
if (err != BZ_OK || (dst_pos == 0 || dst_pos > UNIV_PAGE_SIZE)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %du bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu err %d\n",
|
||||||
|
dst_pos, actual_size, len, err);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_BZIP2 */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: Corruption: Page is marked as compressed\n"
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
@ -578,6 +578,8 @@ innodb_compression_algorithm_validate(
|
|||||||
|
|
||||||
static ibool innodb_have_lzo=IF_LZO(1, 0);
|
static ibool innodb_have_lzo=IF_LZO(1, 0);
|
||||||
static ibool innodb_have_lz4=IF_LZ4(1, 0);
|
static ibool innodb_have_lz4=IF_LZ4(1, 0);
|
||||||
|
static ibool innodb_have_lzma=IF_LZMA(1, 0);
|
||||||
|
static ibool innodb_have_bzip2=IF_BZIP2(1, 0);
|
||||||
|
|
||||||
static const char innobase_hton_name[]= "InnoDB";
|
static const char innobase_hton_name[]= "InnoDB";
|
||||||
|
|
||||||
@ -745,6 +747,10 @@ static SHOW_VAR innodb_status_variables[]= {
|
|||||||
(char*) &innodb_have_lz4, SHOW_BOOL},
|
(char*) &innodb_have_lz4, SHOW_BOOL},
|
||||||
{"have_lzo",
|
{"have_lzo",
|
||||||
(char*) &innodb_have_lzo, SHOW_BOOL},
|
(char*) &innodb_have_lzo, SHOW_BOOL},
|
||||||
|
{"have_lzma",
|
||||||
|
(char*) &innodb_have_lzma, SHOW_BOOL},
|
||||||
|
{"have_bzip2",
|
||||||
|
(char*) &innodb_have_bzip2, SHOW_BOOL},
|
||||||
|
|
||||||
{NullS, NullS, SHOW_LONG}
|
{NullS, NullS, SHOW_LONG}
|
||||||
};
|
};
|
||||||
@ -3026,6 +3032,24 @@ innobase_init(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_LZMA
|
||||||
|
if (innodb_compression_algorithm == PAGE_LZMA_ALGORITHM) {
|
||||||
|
sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: liblzma is not installed. \n",
|
||||||
|
innodb_compression_algorithm);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_BZIP2
|
||||||
|
if (innodb_compression_algorithm == PAGE_BZIP2_ALGORITHM) {
|
||||||
|
sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: libbz2 is not installed. \n",
|
||||||
|
innodb_compression_algorithm);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
os_innodb_umask = (ulint) my_umask;
|
os_innodb_umask = (ulint) my_umask;
|
||||||
|
|
||||||
/* First calculate the default path for innodb_data_home_dir etc.,
|
/* First calculate the default path for innodb_data_home_dir etc.,
|
||||||
@ -17046,7 +17070,7 @@ static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
|
|||||||
"Use trim. Default FALSE.",
|
"Use trim. Default FALSE.",
|
||||||
NULL, NULL, FALSE);
|
NULL, NULL, FALSE);
|
||||||
|
|
||||||
static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", 0 };
|
static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", "lzma", "bzip2", 0 };
|
||||||
static TYPELIB page_compression_algorithms_typelib=
|
static TYPELIB page_compression_algorithms_typelib=
|
||||||
{
|
{
|
||||||
array_elements(page_compression_algorithms) - 1, 0,
|
array_elements(page_compression_algorithms) - 1, 0,
|
||||||
@ -17054,9 +17078,12 @@ static TYPELIB page_compression_algorithms_typelib=
|
|||||||
};
|
};
|
||||||
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
|
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
|
||||||
PLUGIN_VAR_OPCMDARG,
|
PLUGIN_VAR_OPCMDARG,
|
||||||
"Compression algorithm used on page compression. One of: none, zlib, lz4, or lzo",
|
"Compression algorithm used on page compression. One of: none, zlib, lz4, lzo, lzma, or bzip2",
|
||||||
innodb_compression_algorithm_validate, NULL,
|
innodb_compression_algorithm_validate, NULL,
|
||||||
IF_LZO(PAGE_LZO_ALGORITHM, IF_LZ4(PAGE_LZ4_ALGORITHM, PAGE_ZLIB_ALGORITHM)),
|
/* We use here the largest number of supported compression method to
|
||||||
|
enable all those methods that are available. Availability of compression
|
||||||
|
method is verified on innodb_compression_algorithm_validate function. */
|
||||||
|
PAGE_ALGORITHM_LAST,
|
||||||
&page_compression_algorithms_typelib);
|
&page_compression_algorithms_typelib);
|
||||||
|
|
||||||
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
|
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
|
||||||
@ -17804,5 +17831,27 @@ innodb_compression_algorithm_validate(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_LZMA
|
||||||
|
if (compression_algorithm == PAGE_LZMA_ALGORITHM) {
|
||||||
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
HA_ERR_UNSUPPORTED,
|
||||||
|
"InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: liblzma is not installed. \n",
|
||||||
|
compression_algorithm);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_BZIP2
|
||||||
|
if (compression_algorithm == PAGE_BZIP2_ALGORITHM) {
|
||||||
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
HA_ERR_UNSUPPORTED,
|
||||||
|
"InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: libbz2 is not installed. \n",
|
||||||
|
compression_algorithm);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,24 @@ extern fil_addr_t fil_addr_null;
|
|||||||
data file (ibdata*, not *.ibd):
|
data file (ibdata*, not *.ibd):
|
||||||
the file has been flushed to disk
|
the file has been flushed to disk
|
||||||
at least up to this lsn */
|
at least up to this lsn */
|
||||||
|
/** If page type is FIL_PAGE_COMPRESSED then the 8 bytes starting at
|
||||||
|
FIL_PAGE_FILE_FLUSH_LSN are broken down as follows: */
|
||||||
|
|
||||||
|
/** Control information version format (u8) */
|
||||||
|
static const ulint FIL_PAGE_VERSION = FIL_PAGE_FILE_FLUSH_LSN;
|
||||||
|
|
||||||
|
/** Compression algorithm (u8) */
|
||||||
|
static const ulint FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1;
|
||||||
|
|
||||||
|
/** Original page type (u16) */
|
||||||
|
static const ulint FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1;
|
||||||
|
|
||||||
|
/** Original data size in bytes (u16)*/
|
||||||
|
static const ulint FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2;
|
||||||
|
|
||||||
|
/** Size after compression (u16)*/
|
||||||
|
static const ulint FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2;
|
||||||
|
|
||||||
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this
|
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this
|
||||||
contains the space id of the page */
|
contains the space id of the page */
|
||||||
#define FIL_PAGE_SPACE_ID FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
|
#define FIL_PAGE_SPACE_ID FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
|
||||||
@ -162,7 +180,8 @@ extern fil_addr_t fil_addr_null;
|
|||||||
#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */
|
#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */
|
||||||
#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */
|
#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */
|
||||||
#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */
|
#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */
|
||||||
#define FIL_PAGE_TYPE_LAST FIL_PAGE_TYPE_ZBLOB2
|
#define FIL_PAGE_COMPRESSED 13 /*!< Compressed page */
|
||||||
|
#define FIL_PAGE_TYPE_LAST FIL_PAGE_COMPRESSED
|
||||||
/*!< Last page type */
|
/*!< Last page type */
|
||||||
/* @} */
|
/* @} */
|
||||||
|
|
||||||
|
@ -27,11 +27,15 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
|
|||||||
#ifndef fsp0pagecompress_h
|
#ifndef fsp0pagecompress_h
|
||||||
#define fsp0pagecompress_h
|
#define fsp0pagecompress_h
|
||||||
|
|
||||||
#define PAGE_UNCOMPRESSED 0
|
/* Supported page compression methods */
|
||||||
#define PAGE_ZLIB_ALGORITHM 1
|
|
||||||
#define PAGE_LZ4_ALGORITHM 2
|
#define PAGE_UNCOMPRESSED 0
|
||||||
#define PAGE_LZO_ALGORITHM 3
|
#define PAGE_ZLIB_ALGORITHM 1
|
||||||
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
|
#define PAGE_LZ4_ALGORITHM 2
|
||||||
|
#define PAGE_LZO_ALGORITHM 3
|
||||||
|
#define PAGE_LZMA_ALGORITHM 4
|
||||||
|
#define PAGE_BZIP2_ALGORITHM 5
|
||||||
|
#define PAGE_ALGORITHM_LAST PAGE_BZIP2_ALGORITHM
|
||||||
|
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
Reads the page compression level from the first page of a tablespace.
|
Reads the page compression level from the first page of a tablespace.
|
||||||
|
@ -151,6 +151,9 @@ fil_get_compression_alg_name(
|
|||||||
case PAGE_LZO_ALGORITHM:
|
case PAGE_LZO_ALGORITHM:
|
||||||
return ("LZO");
|
return ("LZO");
|
||||||
break;
|
break;
|
||||||
|
case PAGE_LZMA_ALGORITHM:
|
||||||
|
return ("LZMA");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return("UNKNOWN");
|
return("UNKNOWN");
|
||||||
ut_error;
|
ut_error;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2008, Google Inc.
|
Copyright (c) 2008, Google Inc.
|
||||||
|
Copyright (c) 2013, 2014 SkySQL Ab.
|
||||||
|
|
||||||
Portions of this file contain modifications contributed and copyrighted by
|
Portions of this file contain modifications contributed and copyrighted by
|
||||||
Google, Inc. Those modifications are gratefully acknowledged and are described
|
Google, Inc. Those modifications are gratefully acknowledged and are described
|
||||||
@ -343,6 +344,18 @@ typedef enum innodb_file_formats_enum innodb_file_formats_t;
|
|||||||
#define IF_LZ4(A,B) B
|
#define IF_LZ4(A,B) B
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
#define IF_LZMA(A,B) A
|
||||||
|
#else
|
||||||
|
#define IF_LZMA(A,B) B
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
#define IF_BZIP2(A,B) A
|
||||||
|
#else
|
||||||
|
#define IF_BZIP2(A,B) B
|
||||||
|
#endif
|
||||||
|
|
||||||
/** The universal page size of the database */
|
/** The universal page size of the database */
|
||||||
#define UNIV_PAGE_SIZE ((ulint) srv_page_size)
|
#define UNIV_PAGE_SIZE ((ulint) srv_page_size)
|
||||||
|
|
||||||
|
@ -2885,9 +2885,8 @@ try_again:
|
|||||||
os_mutex_exit(os_file_count_mutex);
|
os_mutex_exit(os_file_count_mutex);
|
||||||
|
|
||||||
if (ret && len == n) {
|
if (ret && len == n) {
|
||||||
if (fil_page_is_compressed((byte *)buf)) {
|
fil_decompress_page(NULL, (byte *)buf, len, NULL);
|
||||||
fil_decompress_page(NULL, (byte *)buf, len, NULL);
|
|
||||||
}
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
#else /* __WIN__ */
|
#else /* __WIN__ */
|
||||||
@ -2900,9 +2899,7 @@ try_again:
|
|||||||
ret = os_file_pread(file, buf, n, offset);
|
ret = os_file_pread(file, buf, n, offset);
|
||||||
|
|
||||||
if ((ulint) ret == n) {
|
if ((ulint) ret == n) {
|
||||||
if (fil_page_is_compressed((byte *)buf)) {
|
fil_decompress_page(NULL, (byte *)buf, n, NULL);
|
||||||
fil_decompress_page(NULL, (byte *)buf, n, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -5254,9 +5251,7 @@ os_aio_windows_handle(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (slot->type == OS_FILE_READ) {
|
if (slot->type == OS_FILE_READ) {
|
||||||
if (fil_page_is_compressed(slot->buf)) {
|
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
||||||
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (slot->page_compress_success && fil_page_is_compressed(slot->page_buf)) {
|
if (slot->page_compress_success && fil_page_is_compressed(slot->page_buf)) {
|
||||||
if (srv_use_trim && os_fallocate_failed == FALSE) {
|
if (srv_use_trim && os_fallocate_failed == FALSE) {
|
||||||
@ -5373,9 +5368,7 @@ retry:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (slot->type == OS_FILE_READ) {
|
if (slot->type == OS_FILE_READ) {
|
||||||
if (fil_page_is_compressed(slot->buf)) {
|
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
||||||
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (slot->page_compress_success &&
|
if (slot->page_compress_success &&
|
||||||
fil_page_is_compressed(slot->page_buf)) {
|
fil_page_is_compressed(slot->page_buf)) {
|
||||||
|
@ -154,7 +154,7 @@ UNIV_INTERN my_bool srv_use_trim = FALSE;
|
|||||||
UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE;
|
UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE;
|
||||||
/* If this flag is TRUE, then we disable doublewrite buffer */
|
/* If this flag is TRUE, then we disable doublewrite buffer */
|
||||||
UNIV_INTERN my_bool srv_use_atomic_writes = FALSE;
|
UNIV_INTERN my_bool srv_use_atomic_writes = FALSE;
|
||||||
/* If this flag IS TRUE, then we use lz4 to compress/decompress pages */
|
/* If this flag IS TRUE, then we use this algorithm for page compressing the pages */
|
||||||
UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
|
UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
|
||||||
/* Number of threads used for multi-threaded flush */
|
/* Number of threads used for multi-threaded flush */
|
||||||
UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER;
|
UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER;
|
||||||
|
@ -20,9 +20,13 @@ INCLUDE(CheckCSourceCompiles)
|
|||||||
INCLUDE(CheckCSourceRuns)
|
INCLUDE(CheckCSourceRuns)
|
||||||
INCLUDE(lz4)
|
INCLUDE(lz4)
|
||||||
INCLUDE(lzo)
|
INCLUDE(lzo)
|
||||||
|
INCLUDE(lzma)
|
||||||
|
INCLUDE(bzip2)
|
||||||
|
|
||||||
MYSQL_CHECK_LZ4()
|
MYSQL_CHECK_LZ4()
|
||||||
MYSQL_CHECK_LZO()
|
MYSQL_CHECK_LZO()
|
||||||
|
MYSQL_CHECK_LZMA()
|
||||||
|
MYSQL_CHECK_BZIP2()
|
||||||
|
|
||||||
# OS tests
|
# OS tests
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
|
@ -68,10 +68,184 @@ static ulint srv_data_read, srv_data_written;
|
|||||||
#ifdef HAVE_LZO
|
#ifdef HAVE_LZO
|
||||||
#include "lzo/lzo1x.h"
|
#include "lzo/lzo1x.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
#include "lzma.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
#include "bzlib.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Used for debugging */
|
/* Used for debugging */
|
||||||
//#define UNIV_PAGECOMPRESS_DEBUG 1
|
//#define UNIV_PAGECOMPRESS_DEBUG 1
|
||||||
|
|
||||||
|
/****************************************************************//**
|
||||||
|
For page compressed pages decompress the page after actual read
|
||||||
|
operation. */
|
||||||
|
static
|
||||||
|
void
|
||||||
|
fil_decompress_page_2(
|
||||||
|
/*==================*/
|
||||||
|
byte* page_buf, /*!< out: destination buffer for
|
||||||
|
uncompressed data */
|
||||||
|
byte* buf, /*!< in: source compressed data */
|
||||||
|
ulong len, /*!< in: length of output buffer.*/
|
||||||
|
ulint* write_size) /*!< in/out: Actual payload size of
|
||||||
|
the compressed data. */
|
||||||
|
{
|
||||||
|
ulint page_type = mach_read_from_2(buf + FIL_PAGE_TYPE);
|
||||||
|
|
||||||
|
if (page_type != FIL_PAGE_COMPRESSED) {
|
||||||
|
/* It is not a compressed page */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulint olen = 0;
|
||||||
|
byte* ptr = buf + FIL_PAGE_DATA;
|
||||||
|
ulint version = mach_read_from_1(buf + FIL_PAGE_VERSION);
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
ut_a(version == 1);
|
||||||
|
|
||||||
|
/* Read the original page type, before we compressed the data. */
|
||||||
|
page_type = mach_read_from_2(buf + FIL_PAGE_ORIGINAL_TYPE_V1);
|
||||||
|
|
||||||
|
ulint original_len = mach_read_from_2(buf + FIL_PAGE_ORIGINAL_SIZE_V1);
|
||||||
|
|
||||||
|
if (original_len < UNIV_PAGE_SIZE_MIN - (FIL_PAGE_DATA + 8)
|
||||||
|
|| original_len > UNIV_PAGE_SIZE_MAX - FIL_PAGE_DATA
|
||||||
|
|| len < original_len + FIL_PAGE_DATA) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: We try to uncompress corrupted page\n"
|
||||||
|
"InnoDB: Original len %lu len %lu.\n",
|
||||||
|
original_len, len);
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
ut_error;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ulint algorithm = mach_read_from_1(buf + FIL_PAGE_ALGORITHM_V1);
|
||||||
|
|
||||||
|
switch(algorithm) {
|
||||||
|
case PAGE_ZLIB_ALGORITHM: {
|
||||||
|
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: zlib\n");
|
||||||
|
|
||||||
|
err = uncompress(page_buf, &len, ptr, original_len);
|
||||||
|
/* If uncompress fails it means that page is corrupted */
|
||||||
|
if (err != Z_OK) {
|
||||||
|
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but uncompress failed with error %d.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
err, original_len, len);
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#ifdef HAVE_LZ4
|
||||||
|
case PAGE_LZ4_ALGORITHM: {
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: lz4\n");
|
||||||
|
err = LZ4_decompress_fast(
|
||||||
|
(const char*) ptr, (char*) (page_buf), original_len);
|
||||||
|
|
||||||
|
if (err < 0) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %d bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
err, original_len, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZ4 */
|
||||||
|
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
case PAGE_LZMA_ALGORITHM: {
|
||||||
|
|
||||||
|
lzma_ret ret;
|
||||||
|
size_t src_pos = 0;
|
||||||
|
size_t dst_pos = 0;
|
||||||
|
uint64_t memlimit = UINT64_MAX;
|
||||||
|
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: lzma\n");
|
||||||
|
ret = lzma_stream_buffer_decode(
|
||||||
|
&memlimit,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
ptr,
|
||||||
|
&src_pos,
|
||||||
|
original_len,
|
||||||
|
(page_buf),
|
||||||
|
&dst_pos,
|
||||||
|
len);
|
||||||
|
|
||||||
|
|
||||||
|
if (ret != LZMA_OK || (dst_pos <= 0 || dst_pos > len)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %ld bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
dst_pos, original_len, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZMA */
|
||||||
|
|
||||||
|
#ifdef HAVE_LZO
|
||||||
|
case PAGE_LZO_ALGORITHM: {
|
||||||
|
fprintf(stderr, "InnoDB: [Note]: lzo \n");
|
||||||
|
err = lzo1x_decompress((const unsigned char *)ptr,
|
||||||
|
original_len,(unsigned char *)(page_buf), &olen, NULL);
|
||||||
|
|
||||||
|
if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %ld bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
olen, original_len, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZO */
|
||||||
|
|
||||||
|
default:
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but compression algorithm %s\n"
|
||||||
|
"InnoDB: is not known.\n"
|
||||||
|
,fil_get_compression_alg_name(algorithm));
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
ut_error;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Leave the header alone */
|
||||||
|
memmove(buf+FIL_PAGE_DATA, page_buf, original_len);
|
||||||
|
|
||||||
|
mach_write_to_2(buf + FIL_PAGE_TYPE, page_type);
|
||||||
|
|
||||||
|
ut_ad(memcmp(buf + FIL_PAGE_LSN + 4,
|
||||||
|
buf + (original_len + FIL_PAGE_DATA)
|
||||||
|
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************//**
|
/****************************************************************//**
|
||||||
For page compressed pages compress the page before actual write
|
For page compressed pages compress the page before actual write
|
||||||
operation.
|
operation.
|
||||||
@ -157,6 +331,50 @@ fil_compress_page(
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
#endif /* HAVE_LZO */
|
#endif /* HAVE_LZO */
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
case PAGE_LZMA_ALGORITHM: {
|
||||||
|
size_t out_pos=0;
|
||||||
|
|
||||||
|
err = lzma_easy_buffer_encode(
|
||||||
|
compression_level,
|
||||||
|
LZMA_CHECK_NONE,
|
||||||
|
NULL, /* No custom allocator, use malloc/free */
|
||||||
|
reinterpret_cast<uint8_t*>(buf),
|
||||||
|
len,
|
||||||
|
reinterpret_cast<uint8_t*>(out_buf + header_len),
|
||||||
|
&out_pos,
|
||||||
|
(size_t)&write_size);
|
||||||
|
|
||||||
|
if (err != LZMA_OK || write_size > UNIV_PAGE_SIZE-header_len) {
|
||||||
|
srv_stats.pages_page_compression_error.inc();
|
||||||
|
*out_len = len;
|
||||||
|
return (buf);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZMA */
|
||||||
|
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
case PAGE_BZIP2_ALGORITHM: {
|
||||||
|
|
||||||
|
err = BZ2_bzBuffToBuffCompress(
|
||||||
|
(char *)(out_buf + header_len),
|
||||||
|
(unsigned int *)&write_size,
|
||||||
|
(char *)buf,
|
||||||
|
len,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
|
||||||
|
if (err != BZ_OK || write_size > UNIV_PAGE_SIZE-header_len) {
|
||||||
|
srv_stats.pages_page_compression_error.inc();
|
||||||
|
*out_len = len;
|
||||||
|
return (buf);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_BZIP2 */
|
||||||
|
|
||||||
case PAGE_ZLIB_ALGORITHM:
|
case PAGE_ZLIB_ALGORITHM:
|
||||||
err = compress2(out_buf+header_len, (ulong*)&write_size, buf, len, level);
|
err = compress2(out_buf+header_len, (ulong*)&write_size, buf, len, level);
|
||||||
|
|
||||||
@ -244,10 +462,39 @@ fil_decompress_page(
|
|||||||
ulint compression_alg = 0;
|
ulint compression_alg = 0;
|
||||||
byte *in_buf;
|
byte *in_buf;
|
||||||
ulint olen=0;
|
ulint olen=0;
|
||||||
|
ulint ptype;
|
||||||
|
|
||||||
ut_ad(buf);
|
ut_ad(buf);
|
||||||
ut_ad(len);
|
ut_ad(len);
|
||||||
|
|
||||||
|
ptype = mach_read_from_2(buf+FIL_PAGE_TYPE);
|
||||||
|
|
||||||
|
/* Do not try to uncompressed pages that are not compressed */
|
||||||
|
if (ptype != FIL_PAGE_PAGE_COMPRESSED && ptype != FIL_PAGE_COMPRESSED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If no buffer was given, we need to allocate temporal buffer
|
||||||
|
if (page_buf == NULL) {
|
||||||
|
#ifdef UNIV_PAGECOMPRESS_DEBUG
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Note: FIL: Compression buffer not given, allocating...\n");
|
||||||
|
#endif /* UNIV_PAGECOMPRESS_DEBUG */
|
||||||
|
in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE));
|
||||||
|
} else {
|
||||||
|
in_buf = page_buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ptype == FIL_PAGE_COMPRESSED) {
|
||||||
|
|
||||||
|
fil_decompress_page_2(in_buf, buf, len, write_size);
|
||||||
|
// Need to free temporal buffer if no buffer was given
|
||||||
|
if (page_buf == NULL) {
|
||||||
|
ut_free(in_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Before actual decompress, make sure that page type is correct */
|
/* Before actual decompress, make sure that page type is correct */
|
||||||
|
|
||||||
if (mach_read_from_4(buf+FIL_PAGE_SPACE_OR_CHKSUM) != BUF_NO_CHECKSUM_MAGIC ||
|
if (mach_read_from_4(buf+FIL_PAGE_SPACE_OR_CHKSUM) != BUF_NO_CHECKSUM_MAGIC ||
|
||||||
@ -266,17 +513,6 @@ fil_decompress_page(
|
|||||||
/* Get compression algorithm */
|
/* Get compression algorithm */
|
||||||
compression_alg = mach_read_from_8(buf+FIL_PAGE_FILE_FLUSH_LSN);
|
compression_alg = mach_read_from_8(buf+FIL_PAGE_FILE_FLUSH_LSN);
|
||||||
|
|
||||||
// If no buffer was given, we need to allocate temporal buffer
|
|
||||||
if (page_buf == NULL) {
|
|
||||||
#ifdef UNIV_PAGECOMPRESS_DEBUG
|
|
||||||
fprintf(stderr,
|
|
||||||
"InnoDB: Note: FIL: Compression buffer not given, allocating...\n");
|
|
||||||
#endif /* UNIV_PAGECOMPRESS_DEBUG */
|
|
||||||
in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE));
|
|
||||||
} else {
|
|
||||||
in_buf = page_buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the actual size of compressed page */
|
/* Get the actual size of compressed page */
|
||||||
actual_size = mach_read_from_2(buf+FIL_PAGE_DATA);
|
actual_size = mach_read_from_2(buf+FIL_PAGE_DATA);
|
||||||
/* Check if payload size is corrupted */
|
/* Check if payload size is corrupted */
|
||||||
@ -323,7 +559,7 @@ fil_decompress_page(
|
|||||||
|
|
||||||
#ifdef HAVE_LZ4
|
#ifdef HAVE_LZ4
|
||||||
case PAGE_LZ4_ALGORITHM:
|
case PAGE_LZ4_ALGORITHM:
|
||||||
err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, UNIV_PAGE_SIZE);
|
err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, len);
|
||||||
|
|
||||||
if (err != (int)actual_size) {
|
if (err != (int)actual_size) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@ -353,7 +589,67 @@ fil_decompress_page(
|
|||||||
ut_error;
|
ut_error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif /* HAVE_LZO */
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
case PAGE_LZMA_ALGORITHM: {
|
||||||
|
|
||||||
|
lzma_ret ret;
|
||||||
|
size_t src_pos = 0;
|
||||||
|
size_t dst_pos = 0;
|
||||||
|
uint64_t memlimit = UINT64_MAX;
|
||||||
|
|
||||||
|
ret = lzma_stream_buffer_decode(
|
||||||
|
&memlimit,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE,
|
||||||
|
&src_pos,
|
||||||
|
actual_size,
|
||||||
|
in_buf,
|
||||||
|
&dst_pos,
|
||||||
|
len);
|
||||||
|
|
||||||
|
|
||||||
|
if (ret != LZMA_OK || (dst_pos == 0 || dst_pos > UNIV_PAGE_SIZE)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %ld bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu\n",
|
||||||
|
olen, actual_size, len);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LZMA */
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
case PAGE_BZIP2_ALGORITHM: {
|
||||||
|
unsigned int dst_pos = UNIV_PAGE_SIZE;
|
||||||
|
|
||||||
|
err = BZ2_bzBuffToBuffDecompress(
|
||||||
|
(char *)in_buf,
|
||||||
|
&dst_pos,
|
||||||
|
(char *)(buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE),
|
||||||
|
actual_size,
|
||||||
|
1,
|
||||||
|
0);
|
||||||
|
|
||||||
|
if (err != BZ_OK || (dst_pos == 0 || dst_pos > UNIV_PAGE_SIZE)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
"InnoDB: but decompression read only %du bytes.\n"
|
||||||
|
"InnoDB: size %lu len %lu err %d\n",
|
||||||
|
dst_pos, actual_size, len, err);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_BZIP2 */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: Corruption: Page is marked as compressed\n"
|
"InnoDB: Corruption: Page is marked as compressed\n"
|
||||||
|
@ -719,6 +719,8 @@ static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
|
|||||||
|
|
||||||
static ibool innodb_have_lzo=IF_LZO(1, 0);
|
static ibool innodb_have_lzo=IF_LZO(1, 0);
|
||||||
static ibool innodb_have_lz4=IF_LZ4(1, 0);
|
static ibool innodb_have_lz4=IF_LZ4(1, 0);
|
||||||
|
static ibool innodb_have_lzma=IF_LZMA(1, 0);
|
||||||
|
static ibool innodb_have_bzip2=IF_BZIP2(1, 0);
|
||||||
|
|
||||||
static SHOW_VAR innodb_status_variables[]= {
|
static SHOW_VAR innodb_status_variables[]= {
|
||||||
{"available_undo_logs",
|
{"available_undo_logs",
|
||||||
@ -939,6 +941,10 @@ static SHOW_VAR innodb_status_variables[]= {
|
|||||||
(char*) &innodb_have_lz4, SHOW_BOOL},
|
(char*) &innodb_have_lz4, SHOW_BOOL},
|
||||||
{"have_lzo",
|
{"have_lzo",
|
||||||
(char*) &innodb_have_lzo, SHOW_BOOL},
|
(char*) &innodb_have_lzo, SHOW_BOOL},
|
||||||
|
{"have_lzma",
|
||||||
|
(char*) &innodb_have_lzma, SHOW_BOOL},
|
||||||
|
{"have_bzip2",
|
||||||
|
(char*) &innodb_have_bzip2, SHOW_BOOL},
|
||||||
|
|
||||||
{NullS, NullS, SHOW_LONG}
|
{NullS, NullS, SHOW_LONG}
|
||||||
};
|
};
|
||||||
@ -3411,6 +3417,24 @@ innobase_init(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_LZMA
|
||||||
|
if (innodb_compression_algorithm == PAGE_LZMA_ALGORITHM) {
|
||||||
|
sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: liblzma is not installed. \n",
|
||||||
|
innodb_compression_algorithm);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_BZIP2
|
||||||
|
if (innodb_compression_algorithm == PAGE_BZIP2_ALGORITHM) {
|
||||||
|
sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: libbz2 is not installed. \n",
|
||||||
|
innodb_compression_algorithm);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
os_innodb_umask = (ulint) my_umask;
|
os_innodb_umask = (ulint) my_umask;
|
||||||
|
|
||||||
/* First calculate the default path for innodb_data_home_dir etc.,
|
/* First calculate the default path for innodb_data_home_dir etc.,
|
||||||
@ -18219,7 +18243,7 @@ static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
|
|||||||
"Use trim. Default FALSE.",
|
"Use trim. Default FALSE.",
|
||||||
NULL, NULL, FALSE);
|
NULL, NULL, FALSE);
|
||||||
|
|
||||||
static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", 0 };
|
static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", "lzma", "bzip2", 0 };
|
||||||
static TYPELIB page_compression_algorithms_typelib=
|
static TYPELIB page_compression_algorithms_typelib=
|
||||||
{
|
{
|
||||||
array_elements(page_compression_algorithms) - 1, 0,
|
array_elements(page_compression_algorithms) - 1, 0,
|
||||||
@ -18227,9 +18251,12 @@ static TYPELIB page_compression_algorithms_typelib=
|
|||||||
};
|
};
|
||||||
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
|
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
|
||||||
PLUGIN_VAR_OPCMDARG,
|
PLUGIN_VAR_OPCMDARG,
|
||||||
"Compression algorithm used on page compression. One of: none, zlib, lz4, or lzo",
|
"Compression algorithm used on page compression. One of: none, zlib, lz4, lzo, lzma, or bzip2",
|
||||||
innodb_compression_algorithm_validate, NULL,
|
innodb_compression_algorithm_validate, NULL,
|
||||||
IF_LZO(PAGE_LZO_ALGORITHM, IF_LZ4(PAGE_LZ4_ALGORITHM, PAGE_ZLIB_ALGORITHM)),
|
/* We use here the largest number of supported compression method to
|
||||||
|
enable all those methods that are available. Availability of compression
|
||||||
|
method is verified on innodb_compression_algorithm_validate function. */
|
||||||
|
PAGE_ALGORITHM_LAST,
|
||||||
&page_compression_algorithms_typelib);
|
&page_compression_algorithms_typelib);
|
||||||
|
|
||||||
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
|
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
|
||||||
@ -19023,6 +19050,28 @@ innodb_compression_algorithm_validate(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_LZMA
|
||||||
|
if (compression_algorithm == PAGE_LZMA_ALGORITHM) {
|
||||||
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
HA_ERR_UNSUPPORTED,
|
||||||
|
"InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: liblzma is not installed. \n",
|
||||||
|
compression_algorithm);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_BZIP2
|
||||||
|
if (compression_algorithm == PAGE_BZIP2_ALGORITHM) {
|
||||||
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
HA_ERR_UNSUPPORTED,
|
||||||
|
"InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
|
||||||
|
"InnoDB: libbz2 is not installed. \n",
|
||||||
|
compression_algorithm);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,24 @@ extern fil_addr_t fil_addr_null;
|
|||||||
data file (ibdata*, not *.ibd):
|
data file (ibdata*, not *.ibd):
|
||||||
the file has been flushed to disk
|
the file has been flushed to disk
|
||||||
at least up to this lsn */
|
at least up to this lsn */
|
||||||
|
/** If page type is FIL_PAGE_COMPRESSED then the 8 bytes starting at
|
||||||
|
FIL_PAGE_FILE_FLUSH_LSN are broken down as follows: */
|
||||||
|
|
||||||
|
/** Control information version format (u8) */
|
||||||
|
static const ulint FIL_PAGE_VERSION = FIL_PAGE_FILE_FLUSH_LSN;
|
||||||
|
|
||||||
|
/** Compression algorithm (u8) */
|
||||||
|
static const ulint FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1;
|
||||||
|
|
||||||
|
/** Original page type (u16) */
|
||||||
|
static const ulint FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1;
|
||||||
|
|
||||||
|
/** Original data size in bytes (u16)*/
|
||||||
|
static const ulint FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2;
|
||||||
|
|
||||||
|
/** Size after compression (u16)*/
|
||||||
|
static const ulint FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2;
|
||||||
|
|
||||||
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this
|
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this
|
||||||
contains the space id of the page */
|
contains the space id of the page */
|
||||||
#define FIL_PAGE_SPACE_ID FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
|
#define FIL_PAGE_SPACE_ID FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
|
||||||
@ -164,7 +182,8 @@ extern fil_addr_t fil_addr_null;
|
|||||||
#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */
|
#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */
|
||||||
#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */
|
#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */
|
||||||
#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */
|
#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */
|
||||||
#define FIL_PAGE_TYPE_LAST FIL_PAGE_TYPE_ZBLOB2
|
#define FIL_PAGE_COMPRESSED 13 /*!< Compressed page */
|
||||||
|
#define FIL_PAGE_TYPE_LAST FIL_PAGE_COMPRESSED
|
||||||
/*!< Last page type */
|
/*!< Last page type */
|
||||||
/* @} */
|
/* @} */
|
||||||
|
|
||||||
|
@ -27,11 +27,15 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
|
|||||||
#ifndef fsp0pagecompress_h
|
#ifndef fsp0pagecompress_h
|
||||||
#define fsp0pagecompress_h
|
#define fsp0pagecompress_h
|
||||||
|
|
||||||
#define PAGE_UNCOMPRESSED 0
|
/* Supported page compression methods */
|
||||||
#define PAGE_ZLIB_ALGORITHM 1
|
|
||||||
#define PAGE_LZ4_ALGORITHM 2
|
#define PAGE_UNCOMPRESSED 0
|
||||||
#define PAGE_LZO_ALGORITHM 3
|
#define PAGE_ZLIB_ALGORITHM 1
|
||||||
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
|
#define PAGE_LZ4_ALGORITHM 2
|
||||||
|
#define PAGE_LZO_ALGORITHM 3
|
||||||
|
#define PAGE_LZMA_ALGORITHM 4
|
||||||
|
#define PAGE_BZIP2_ALGORITHM 5
|
||||||
|
#define PAGE_ALGORITHM_LAST PAGE_BZIP2_ALGORITHM
|
||||||
|
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
Reads the page compression level from the first page of a tablespace.
|
Reads the page compression level from the first page of a tablespace.
|
||||||
|
@ -151,6 +151,9 @@ fil_get_compression_alg_name(
|
|||||||
case PAGE_LZO_ALGORITHM:
|
case PAGE_LZO_ALGORITHM:
|
||||||
return ("LZO");
|
return ("LZO");
|
||||||
break;
|
break;
|
||||||
|
case PAGE_LZMA_ALGORITHM:
|
||||||
|
return ("LZMA");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return("UNKNOWN");
|
return("UNKNOWN");
|
||||||
ut_error;
|
ut_error;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2008, Google Inc.
|
Copyright (c) 2008, Google Inc.
|
||||||
|
Copyright (c) 2013, 2014 SkySQL Ab.
|
||||||
|
|
||||||
Portions of this file contain modifications contributed and copyrighted by
|
Portions of this file contain modifications contributed and copyrighted by
|
||||||
Google, Inc. Those modifications are gratefully acknowledged and are described
|
Google, Inc. Those modifications are gratefully acknowledged and are described
|
||||||
@ -358,6 +359,18 @@ typedef enum innodb_file_formats_enum innodb_file_formats_t;
|
|||||||
#define IF_LZ4(A,B) B
|
#define IF_LZ4(A,B) B
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LZMA
|
||||||
|
#define IF_LZMA(A,B) A
|
||||||
|
#else
|
||||||
|
#define IF_LZMA(A,B) B
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BZIP2
|
||||||
|
#define IF_BZIP2(A,B) A
|
||||||
|
#else
|
||||||
|
#define IF_BZIP2(A,B) B
|
||||||
|
#endif
|
||||||
|
|
||||||
/** The universal page size of the database */
|
/** The universal page size of the database */
|
||||||
#define UNIV_PAGE_SIZE ((ulint) srv_page_size)
|
#define UNIV_PAGE_SIZE ((ulint) srv_page_size)
|
||||||
|
|
||||||
|
@ -3081,9 +3081,8 @@ try_again:
|
|||||||
os_mutex_exit(os_file_count_mutex);
|
os_mutex_exit(os_file_count_mutex);
|
||||||
|
|
||||||
if (ret && len == n) {
|
if (ret && len == n) {
|
||||||
if (fil_page_is_compressed((byte *)buf)) {
|
fil_decompress_page(NULL, (byte *)buf, len, NULL);
|
||||||
fil_decompress_page(NULL, (byte *)buf, len, NULL);
|
|
||||||
}
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
#else /* __WIN__ */
|
#else /* __WIN__ */
|
||||||
@ -3097,9 +3096,7 @@ try_again:
|
|||||||
|
|
||||||
if ((ulint) ret == n) {
|
if ((ulint) ret == n) {
|
||||||
|
|
||||||
if (fil_page_is_compressed((byte *)buf)) {
|
fil_decompress_page(NULL, (byte *)buf, n, NULL);
|
||||||
fil_decompress_page(NULL, (byte *)buf, n, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -3201,9 +3198,7 @@ try_again:
|
|||||||
|
|
||||||
if ((ulint) ret == n) {
|
if ((ulint) ret == n) {
|
||||||
|
|
||||||
if (fil_page_is_compressed((byte *)buf)) {
|
fil_decompress_page(NULL, (byte *)buf, n, NULL);
|
||||||
fil_decompress_page(NULL, (byte *)buf, n, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -5321,9 +5316,7 @@ os_aio_windows_handle(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (slot->type == OS_FILE_READ) {
|
if (slot->type == OS_FILE_READ) {
|
||||||
if (fil_page_is_compressed(slot->buf)) {
|
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
||||||
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (slot->page_compress_success && fil_page_is_compressed(slot->page_buf)) {
|
if (slot->page_compress_success && fil_page_is_compressed(slot->page_buf)) {
|
||||||
if (srv_use_trim && os_fallocate_failed == FALSE) {
|
if (srv_use_trim && os_fallocate_failed == FALSE) {
|
||||||
@ -5439,9 +5432,7 @@ retry:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (slot->type == OS_FILE_READ) {
|
if (slot->type == OS_FILE_READ) {
|
||||||
if (fil_page_is_compressed(slot->buf)) {
|
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
||||||
fil_decompress_page(slot->page_buf, slot->buf, slot->len, slot->write_size);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (slot->page_compress_success &&
|
if (slot->page_compress_success &&
|
||||||
fil_page_is_compressed(slot->page_buf)) {
|
fil_page_is_compressed(slot->page_buf)) {
|
||||||
|
@ -172,7 +172,7 @@ UNIV_INTERN my_bool srv_use_trim = FALSE;
|
|||||||
UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE;
|
UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE;
|
||||||
/* If this flag is TRUE, then we disable doublewrite buffer */
|
/* If this flag is TRUE, then we disable doublewrite buffer */
|
||||||
UNIV_INTERN my_bool srv_use_atomic_writes = FALSE;
|
UNIV_INTERN my_bool srv_use_atomic_writes = FALSE;
|
||||||
/* If this flag IS TRUE, then we use lz4 to compress/decompress pages */
|
/* If this flag IS TRUE, then we use this algorithm for page compressing the pages */
|
||||||
UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
|
UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
|
||||||
/* Number of threads used for multi-threaded flush */
|
/* Number of threads used for multi-threaded flush */
|
||||||
UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER;
|
UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER;
|
||||||
|
Reference in New Issue
Block a user