Commit b96697d2 authored by Jan Lindström's avatar Jan Lindström

MDEV-6648: InnoDB: Add support for 4K sector size if supported

New generation hard drives, SSDs and NVM devices support 4K
sector size. Supported sector size can be found using fstatvfs()
or GetDiskFreeSpace() functions.
parent e48fbd28
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
#cmakedefine HAVE_SYS_TYPES_H 1 #cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_SYS_UN_H 1 #cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_SYS_VADVISE_H 1 #cmakedefine HAVE_SYS_VADVISE_H 1
#cmakedefine HAVE_SYS_STATVFS_H 1
#cmakedefine HAVE_TERM_H 1 #cmakedefine HAVE_TERM_H 1
#cmakedefine HAVE_TERMBITS_H 1 #cmakedefine HAVE_TERMBITS_H 1
#cmakedefine HAVE_TERMIOS_H 1 #cmakedefine HAVE_TERMIOS_H 1
......
...@@ -260,6 +260,7 @@ CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H) ...@@ -260,6 +260,7 @@ CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H)
CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H) CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H)
CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H) CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H)
CHECK_INCLUDE_FILES (sys/utsname.h HAVE_SYS_UTSNAME_H) CHECK_INCLUDE_FILES (sys/utsname.h HAVE_SYS_UTSNAME_H)
CHECK_INCLUDE_FILES (sys/statvfs.h HAVE_SYS_STATVFS_H)
SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DPACKAGE=test) # bfd.h is picky SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DPACKAGE=test) # bfd.h is picky
CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS) CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS)
......
...@@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( ...@@ -167,6 +167,90 @@ 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
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;
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
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;
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 = 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;
...@@ -211,6 +295,48 @@ count(*) ...@@ -211,6 +295,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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; 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;
...@@ -255,6 +381,48 @@ count(*) ...@@ -255,6 +381,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -167,6 +167,91 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( ...@@ -167,6 +167,91 @@ 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
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
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;
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 = 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;
...@@ -211,6 +296,48 @@ count(*) ...@@ -211,6 +296,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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; 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;
...@@ -255,6 +382,48 @@ count(*) ...@@ -255,6 +382,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( ...@@ -167,6 +167,90 @@ 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
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;
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
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;
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 = 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;
...@@ -211,6 +295,48 @@ count(*) ...@@ -211,6 +295,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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; 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;
...@@ -255,6 +381,48 @@ count(*) ...@@ -255,6 +381,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( ...@@ -167,6 +167,90 @@ 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
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;
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
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;
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 = 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;
...@@ -211,6 +295,48 @@ count(*) ...@@ -211,6 +295,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( ...@@ -167,6 +167,90 @@ 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
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;
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
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;
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; 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;
...@@ -211,6 +295,48 @@ count(*) ...@@ -211,6 +295,48 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress ...@@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress
show warnings; show warnings;
show create table innodb_compressed; show create table innodb_compressed;
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;
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;
--source include/restart_mysqld.inc
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;
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;
...@@ -116,6 +160,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -116,6 +160,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 # 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;
...@@ -140,6 +207,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -140,6 +207,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress ...@@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress
show warnings; show warnings;
show create table innodb_compressed; show create table innodb_compressed;
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;
--source include/restart_mysqld.inc
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;
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;
...@@ -117,6 +161,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -117,6 +161,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 # 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;
...@@ -141,6 +208,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -141,6 +208,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -92,6 +92,49 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress ...@@ -92,6 +92,49 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress
show warnings; show warnings;
show create table innodb_compressed; show create table innodb_compressed;
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;
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;
--source include/restart_mysqld.inc
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;
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;
...@@ -117,6 +160,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -117,6 +160,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 # 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;
...@@ -141,6 +207,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -141,6 +207,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress ...@@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress
show warnings; show warnings;
show create table innodb_compressed; show create table innodb_compressed;
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;
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;
--source include/restart_mysqld.inc
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;
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;
...@@ -116,6 +160,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; ...@@ -116,6 +160,29 @@ 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;
--source include/restart_mysqld.inc
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compressed; drop table innodb_compressed;
......
...@@ -91,6 +91,49 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress ...@@ -91,6 +91,49 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress
show warnings; show warnings;
show create table innodb_compressed; show create table innodb_compressed;
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;
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;
--source include/restart_mysqld.inc
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;
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 # none
set global innodb_compression_algorithm = 0; set global innodb_compression_algorithm = 0;
...@@ -115,6 +158,28 @@ select count(*) from innodb_page_compressed6 where c1 < 500000; ...@@ -115,6 +158,28 @@ 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;
--source include/restart_mysqld.inc
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;
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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
......
...@@ -164,7 +164,12 @@ compression_pad_increments disabled ...@@ -164,7 +164,12 @@ compression_pad_increments disabled
compression_pad_decrements disabled compression_pad_decrements disabled
compress_saved disabled compress_saved disabled
compress_trim_sect512 disabled compress_trim_sect512 disabled
compress_trim_sect1024 disabled
compress_trim_sect2048 disabled
compress_trim_sect4096 disabled compress_trim_sect4096 disabled
compress_trim_sect8192 disabled
compress_trim_sect16384 disabled
compress_trim_sect32768 disabled
compress_pages_page_compressed disabled compress_pages_page_compressed disabled
compress_page_compressed_trim_op disabled compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
......
...@@ -164,7 +164,12 @@ compression_pad_increments disabled ...@@ -164,7 +164,12 @@ compression_pad_increments disabled
compression_pad_decrements disabled compression_pad_decrements disabled
compress_saved disabled compress_saved disabled
compress_trim_sect512 disabled compress_trim_sect512 disabled
compress_trim_sect1024 disabled
compress_trim_sect2048 disabled
compress_trim_sect4096 disabled compress_trim_sect4096 disabled
compress_trim_sect8192 disabled
compress_trim_sect16384 disabled
compress_trim_sect32768 disabled
compress_pages_page_compressed disabled compress_pages_page_compressed disabled
compress_page_compressed_trim_op disabled compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
......
...@@ -164,7 +164,12 @@ compression_pad_increments disabled ...@@ -164,7 +164,12 @@ compression_pad_increments disabled
compression_pad_decrements disabled compression_pad_decrements disabled
compress_saved disabled compress_saved disabled
compress_trim_sect512 disabled compress_trim_sect512 disabled
compress_trim_sect1024 disabled
compress_trim_sect2048 disabled
compress_trim_sect4096 disabled compress_trim_sect4096 disabled
compress_trim_sect8192 disabled
compress_trim_sect16384 disabled
compress_trim_sect32768 disabled
compress_pages_page_compressed disabled compress_pages_page_compressed disabled
compress_page_compressed_trim_op disabled compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
......
...@@ -164,7 +164,12 @@ compression_pad_increments disabled ...@@ -164,7 +164,12 @@ compression_pad_increments disabled
compression_pad_decrements disabled compression_pad_decrements disabled
compress_saved disabled compress_saved disabled
compress_trim_sect512 disabled compress_trim_sect512 disabled
compress_trim_sect1024 disabled
compress_trim_sect2048 disabled
compress_trim_sect4096 disabled compress_trim_sect4096 disabled
compress_trim_sect8192 disabled
compress_trim_sect16384 disabled
compress_trim_sect32768 disabled
compress_pages_page_compressed disabled compress_pages_page_compressed disabled
compress_page_compressed_trim_op disabled compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2014 SkySQL Ab. All Rights Reserved. Copyright (c) 2013, 2014, MariaDB Corporation. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -181,6 +181,7 @@ struct fil_node_t { ...@@ -181,6 +181,7 @@ struct fil_node_t {
ib_int64_t flush_counter;/*!< up to what ib_int64_t flush_counter;/*!< up to what
modification_counter value we have modification_counter value we have
flushed the modifications to disk */ flushed the modifications to disk */
ulint file_block_size;/*!< file system block size */
UT_LIST_NODE_T(fil_node_t) chain; UT_LIST_NODE_T(fil_node_t) chain;
/*!< link field for the file chain */ /*!< link field for the file chain */
UT_LIST_NODE_T(fil_node_t) LRU; UT_LIST_NODE_T(fil_node_t) LRU;
...@@ -778,6 +779,8 @@ fil_node_open_file( ...@@ -778,6 +779,8 @@ fil_node_open_file(
size_bytes = os_file_get_size(node->handle); size_bytes = os_file_get_size(node->handle);
ut_a(size_bytes != (os_offset_t) -1); ut_a(size_bytes != (os_offset_t) -1);
node->file_block_size = os_file_get_block_size(node->handle, node->name);
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
if (space->id == 0) { if (space->id == 0) {
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
...@@ -927,6 +930,10 @@ add_size: ...@@ -927,6 +930,10 @@ add_size:
&ret, atomic_writes); &ret, atomic_writes);
} }
if (node->file_block_size == 0) {
node->file_block_size = os_file_get_block_size(node->handle, node->name);
}
ut_a(ret); ut_a(ret);
node->open = TRUE; node->open = TRUE;
...@@ -5185,6 +5192,11 @@ retry: ...@@ -5185,6 +5192,11 @@ retry:
start_page_no = space->size; start_page_no = space->size;
file_start_page_no = space->size - node->size; file_start_page_no = space->size - node->size;
/* Determine correct file block size */
if (node->file_block_size == 0) {
node->file_block_size = os_file_get_block_size(node->handle, node->name);
}
#ifdef HAVE_POSIX_FALLOCATE #ifdef HAVE_POSIX_FALLOCATE
if (srv_use_posix_fallocate) { if (srv_use_posix_fallocate) {
os_offset_t start_offset = start_page_no * page_size; os_offset_t start_offset = start_page_no * page_size;
...@@ -6721,36 +6733,47 @@ fil_get_page_type_name( ...@@ -6721,36 +6733,47 @@ fil_get_page_type_name(
{ {
switch(page_type) { switch(page_type) {
case FIL_PAGE_PAGE_COMPRESSED: case FIL_PAGE_PAGE_COMPRESSED:
return "PAGE_COMPRESSED"; return (const char*)"PAGE_COMPRESSED";
case FIL_PAGE_INDEX: case FIL_PAGE_INDEX:
return "INDEX"; return (const char*)"INDEX";
case FIL_PAGE_UNDO_LOG: case FIL_PAGE_UNDO_LOG:
return "UNDO LOG"; return (const char*)"UNDO LOG";
case FIL_PAGE_INODE: case FIL_PAGE_INODE:
return "INODE"; return (const char*)"INODE";
case FIL_PAGE_IBUF_FREE_LIST: case FIL_PAGE_IBUF_FREE_LIST:
return "IBUF_FREE_LIST"; return (const char*)"IBUF_FREE_LIST";
case FIL_PAGE_TYPE_ALLOCATED: case FIL_PAGE_TYPE_ALLOCATED:
return "ALLOCATED"; return (const char*)"ALLOCATED";
case FIL_PAGE_IBUF_BITMAP: case FIL_PAGE_IBUF_BITMAP:
return "IBUF_BITMAP"; return (const char*)"IBUF_BITMAP";
case FIL_PAGE_TYPE_SYS: case FIL_PAGE_TYPE_SYS:
return "SYS"; return (const char*)"SYS";
case FIL_PAGE_TYPE_TRX_SYS: case FIL_PAGE_TYPE_TRX_SYS:
return "TRX_SYS"; return (const char*)"TRX_SYS";
case FIL_PAGE_TYPE_FSP_HDR: case FIL_PAGE_TYPE_FSP_HDR:
return "FSP_HDR"; return (const char*)"FSP_HDR";
case FIL_PAGE_TYPE_XDES: case FIL_PAGE_TYPE_XDES:
return "XDES"; return (const char*)"XDES";
case FIL_PAGE_TYPE_BLOB: case FIL_PAGE_TYPE_BLOB:
return "BLOB"; return (const char*)"BLOB";
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
return "ZBLOB"; return (const char*)"ZBLOB";
case FIL_PAGE_TYPE_ZBLOB2: case FIL_PAGE_TYPE_ZBLOB2:
return "ZBLOB2"; return (const char*)"ZBLOB2";
case FIL_PAGE_TYPE_COMPRESSED: case FIL_PAGE_TYPE_COMPRESSED:
return "ORACLE PAGE COMPRESSED"; return (const char*)"ORACLE PAGE COMPRESSED";
default: default:
return "PAGE TYPE CORRUPTED"; return (const char*)"PAGE TYPE CORRUPTED";
} }
} }
/****************************************************************//**
Get block size from fil node
@return block size*/
ulint
fil_node_get_block_size(
/*====================*/
fil_node_t* node) /*!< in: Node where to get block
size */
{
return (node->file_block_size);
}
...@@ -260,6 +260,7 @@ fil_compress_page( ...@@ -260,6 +260,7 @@ fil_compress_page(
byte* out_buf, /*!< out: compressed buffer */ byte* out_buf, /*!< out: compressed buffer */
ulint len, /*!< in: length of input buffer.*/ ulint len, /*!< in: length of input buffer.*/
ulint compression_level, /* in: compression level */ ulint compression_level, /* in: compression level */
ulint block_size, /*!< in: block size */
ulint* out_len, /*!< out: actual length of compressed ulint* out_len, /*!< out: actual length of compressed
page */ page */
byte* lzo_mem) /*!< in: temporal memory used by LZO */ byte* lzo_mem) /*!< in: temporal memory used by LZO */
...@@ -453,12 +454,11 @@ fil_compress_page( ...@@ -453,12 +454,11 @@ fil_compress_page(
write_size+=header_len; write_size+=header_len;
#define SECT_SIZE 512
/* Actual write needs to be alligned on block size */ /* Actual write needs to be alligned on block size */
if (write_size % SECT_SIZE) { if (write_size % block_size) {
write_size = (write_size + SECT_SIZE-1) & ~(SECT_SIZE-1); ut_a(block_size > 0);
ut_a((write_size % SECT_SIZE) == 0); write_size = (write_size + block_size-1) & ~(block_size-1);
ut_a((write_size % block_size) == 0);
} }
#ifdef UNIV_PAGECOMPRESS_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
......
...@@ -93,6 +93,7 @@ fil_compress_page( ...@@ -93,6 +93,7 @@ fil_compress_page(
byte* out_buf, /*!< out: compressed buffer */ byte* out_buf, /*!< out: compressed buffer */
ulint len, /*!< in: length of input buffer.*/ ulint len, /*!< in: length of input buffer.*/
ulint compression_level, /*!< in: compression level */ ulint compression_level, /*!< in: compression level */
ulint block_size, /*!< in: block size */
ulint* out_len, /*!< out: actual length of compressed ulint* out_len, /*!< out: actual length of compressed
page */ page */
byte* lzo_mem); /*!< in: temporal memory used by LZO */ byte* lzo_mem); /*!< in: temporal memory used by LZO */
...@@ -119,6 +120,13 @@ fil_node_get_space_id( ...@@ -119,6 +120,13 @@ fil_node_get_space_id(
/*==================*/ /*==================*/
fil_node_t* node); /*!< in: Node where to get space id*/ fil_node_t* node); /*!< in: Node where to get space id*/
/****************************************************************//**
Get block size from fil node
@return block size*/
ulint
fil_node_get_block_size(
fil_node_t* node); /*!< in: Node where to get block
size */
/*******************************************************************//** /*******************************************************************//**
Find out wheather the page is page compressed Find out wheather the page is page compressed
@return true if page is page compressed*/ @return true if page is page compressed*/
......
...@@ -1333,6 +1333,16 @@ os_file_handle_error_no_exit( ...@@ -1333,6 +1333,16 @@ os_file_handle_error_no_exit(
const char* file, /*!< in: file name */ const char* file, /*!< in: file name */
const ulint line); /*!< in: line */ const ulint line); /*!< in: line */
/***********************************************************************//**
Try to get number of bytes per sector from file system.
@return file block size */
UNIV_INTERN
ulint
os_file_get_block_size(
/*===================*/
os_file_t file, /*!< in: handle to a file */
const char* name); /*!< in: file name */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "os0file.ic" #include "os0file.ic"
#endif #endif
......
...@@ -310,7 +310,12 @@ enum monitor_id_t { ...@@ -310,7 +310,12 @@ enum monitor_id_t {
/* New monitor variables for page compression */ /* New monitor variables for page compression */
MONITOR_OVLD_PAGE_COMPRESS_SAVED, MONITOR_OVLD_PAGE_COMPRESS_SAVED,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768,
MONITOR_OVLD_PAGES_PAGE_COMPRESSED, MONITOR_OVLD_PAGES_PAGE_COMPRESSED,
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP,
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED,
......
...@@ -107,8 +107,18 @@ struct srv_stats_t { ...@@ -107,8 +107,18 @@ struct srv_stats_t {
ulint_ctr_64_t page_compression_saved; ulint_ctr_64_t page_compression_saved;
/** Number of 512Byte TRIM by page compression */ /** Number of 512Byte TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect512; ulint_ctr_64_t page_compression_trim_sect512;
/** Number of 1K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect1024;
/** Number of 2K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect2048;
/** Number of 4K TRIM by page compression */ /** Number of 4K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect4096; ulint_ctr_64_t page_compression_trim_sect4096;
/** Number of 8K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect8192;
/** Number of 16K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect16384;
/** Number of 32K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect32768;
/* Number of index pages written */ /* Number of index pages written */
ulint_ctr_64_t index_pages_written; ulint_ctr_64_t index_pages_written;
/* Number of non index pages written */ /* Number of non index pages written */
...@@ -930,8 +940,18 @@ struct export_var_t{ ...@@ -930,8 +940,18 @@ struct export_var_t{
by page compression */ by page compression */
ib_int64_t innodb_page_compression_trim_sect512;/*!< Number of 512b TRIM ib_int64_t innodb_page_compression_trim_sect512;/*!< Number of 512b TRIM
by page compression */ by page compression */
ib_int64_t innodb_page_compression_trim_sect1024;/*!< Number of 1K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect2048;/*!< Number of 2K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect4096;/*!< Number of 4K byte TRIM ib_int64_t innodb_page_compression_trim_sect4096;/*!< Number of 4K byte TRIM
by page compression */ by page compression */
ib_int64_t innodb_page_compression_trim_sect8192;/*!< Number of 8K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect16384;/*!< Number of 16K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect32768;/*!< Number of 32K TRIM
by page compression */
ib_int64_t innodb_index_pages_written; /*!< Number of index pages ib_int64_t innodb_index_pages_written; /*!< Number of index pages
written */ written */
ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. Copyright (c) 2013, 2014, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted Portions of this file contain modifications contributed and copyrighted
by Percona Inc.. Those modifications are by Percona Inc.. Those modifications are
...@@ -73,6 +73,10 @@ Created 10/21/1995 Heikki Tuuri ...@@ -73,6 +73,10 @@ Created 10/21/1995 Heikki Tuuri
# endif # endif
#endif #endif
#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
#ifdef HAVE_LZO #ifdef HAVE_LZO
#include "lzo/lzo1x.h" #include "lzo/lzo1x.h"
#endif #endif
...@@ -219,6 +223,10 @@ struct os_aio_slot_t{ ...@@ -219,6 +223,10 @@ struct os_aio_slot_t{
free this */ free this */
ibool page_compress_success; ibool page_compress_success;
/*!< TRUE if page compression was
successfull, false if not */
ulint file_block_size;/*!< file block size */
#ifdef WIN_ASYNC_IO #ifdef WIN_ASYNC_IO
HANDLE handle; /*!< handle object we need in the HANDLE handle; /*!< handle object we need in the
...@@ -354,9 +362,7 @@ UNIV_INTERN ...@@ -354,9 +362,7 @@ UNIV_INTERN
ibool ibool
os_file_trim( os_file_trim(
/*=========*/ /*=========*/
os_file_t file, /*!< in: file to be trimmed */ os_aio_slot_t* slot); /*!< in: slot structure */
os_aio_slot_t* slot, /*!< in: slot structure */
ulint len); /*!< in: length of area */
/**********************************************************************//** /**********************************************************************//**
Allocate memory for temporal buffer used for page compression. This Allocate memory for temporal buffer used for page compression. This
...@@ -4612,6 +4618,7 @@ found: ...@@ -4612,6 +4618,7 @@ found:
slot->write_size = write_size; slot->write_size = write_size;
slot->page_compression_level = page_compression_level; slot->page_compression_level = page_compression_level;
slot->page_compression = page_compression; slot->page_compression = page_compression;
slot->file_block_size = fil_node_get_block_size(message1);
/* If the space is page compressed and this is write operation /* If the space is page compressed and this is write operation
then we compress the page */ then we compress the page */
...@@ -4640,6 +4647,7 @@ found: ...@@ -4640,6 +4647,7 @@ found:
slot->page_buf, slot->page_buf,
len, len,
page_compression_level, page_compression_level,
fil_node_get_block_size(slot->message1),
&real_len, &real_len,
slot->lzo_mem slot->lzo_mem
); );
...@@ -5344,7 +5352,7 @@ os_aio_windows_handle( ...@@ -5344,7 +5352,7 @@ os_aio_windows_handle(
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) {
// Deallocate unused blocks from file system // Deallocate unused blocks from file system
os_file_trim(slot->file, slot, slot->len); os_file_trim(slot);
} }
} }
} }
...@@ -5463,7 +5471,7 @@ retry: ...@@ -5463,7 +5471,7 @@ retry:
ut_ad(slot->page_compression_page); ut_ad(slot->page_compression_page);
if (srv_use_trim && os_fallocate_failed == FALSE) { if (srv_use_trim && os_fallocate_failed == FALSE) {
// Deallocate unused blocks from file system // Deallocate unused blocks from file system
os_file_trim(slot->file, slot, slot->len); os_file_trim(slot);
} }
} }
} }
...@@ -6332,17 +6340,18 @@ UNIV_INTERN ...@@ -6332,17 +6340,18 @@ UNIV_INTERN
ibool ibool
os_file_trim( os_file_trim(
/*=========*/ /*=========*/
os_file_t file, /*!< in: file to be trimmed */ os_aio_slot_t* slot) /*!< in: slot structure */
os_aio_slot_t* slot, /*!< in: slot structure */
ulint len) /*!< in: length of area */
{ {
#define SECT_SIZE 512 size_t len = slot->len;
size_t trim_len = UNIV_PAGE_SIZE - len; size_t trim_len = UNIV_PAGE_SIZE - len;
os_offset_t off = slot->offset + len; os_offset_t off = slot->offset + len;
size_t bsize = slot->file_block_size;
// len here should be alligned to sector size // len here should be alligned to sector size
ut_a((trim_len % SECT_SIZE) == 0); ut_ad((trim_len % bsize) == 0);
ut_a((len % SECT_SIZE) == 0); ut_ad((len % bsize) == 0);
ut_ad(bsize != 0);
// Nothing to do if trim length is zero or if actual write // Nothing to do if trim length is zero or if actual write
// size is initialized and it is smaller than current write size. // size is initialized and it is smaller than current write size.
...@@ -6372,7 +6381,7 @@ os_file_trim( ...@@ -6372,7 +6381,7 @@ os_file_trim(
#ifdef __linux__ #ifdef __linux__
#if defined(FALLOC_FL_PUNCH_HOLE) && defined (FALLOC_FL_KEEP_SIZE) #if defined(FALLOC_FL_PUNCH_HOLE) && defined (FALLOC_FL_KEEP_SIZE)
int ret = fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len); int ret = fallocate(slot->file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len);
if (ret) { if (ret) {
/* After first failure do not try to trim again */ /* After first failure do not try to trim again */
...@@ -6416,7 +6425,8 @@ os_file_trim( ...@@ -6416,7 +6425,8 @@ os_file_trim(
flt.Ranges[0].Offset = off; flt.Ranges[0].Offset = off;
flt.Ranges[0].Length = trim_len; flt.Ranges[0].Length = trim_len;
BOOL ret = DeviceIoControl(file,FSCTL_FILE_LEVEL_TRIM,&flt, sizeof(flt), NULL, NULL, NULL, NULL); BOOL ret = DeviceIoControl(slot->file, FSCTL_FILE_LEVEL_TRIM,
&flt, sizeof(flt), NULL, NULL, NULL, NULL);
if (!ret) { if (!ret) {
/* After first failure do not try to trim again */ /* After first failure do not try to trim again */
...@@ -6442,8 +6452,32 @@ os_file_trim( ...@@ -6442,8 +6452,32 @@ os_file_trim(
} }
#endif #endif
srv_stats.page_compression_trim_sect512.add((trim_len / SECT_SIZE)); switch(bsize) {
srv_stats.page_compression_trim_sect4096.add((trim_len / (SECT_SIZE*8))); case 512:
srv_stats.page_compression_trim_sect512.add((trim_len / bsize));
break;
case 1024:
srv_stats.page_compression_trim_sect1024.add((trim_len / bsize));
break;
case 2948:
srv_stats.page_compression_trim_sect2048.add((trim_len / bsize));
break;
case 4096:
srv_stats.page_compression_trim_sect4096.add((trim_len / bsize));
break;
case 8192:
srv_stats.page_compression_trim_sect8192.add((trim_len / bsize));
break;
case 16384:
srv_stats.page_compression_trim_sect16384.add((trim_len / bsize));
break;
case 32768:
srv_stats.page_compression_trim_sect32768.add((trim_len / bsize));
break;
default:
break;
}
srv_stats.page_compressed_trim_op.inc(); srv_stats.page_compressed_trim_op.inc();
return (TRUE); return (TRUE);
...@@ -6487,3 +6521,57 @@ os_slot_alloc_lzo_mem( ...@@ -6487,3 +6521,57 @@ os_slot_alloc_lzo_mem(
ut_a(slot->lzo_mem != NULL); ut_a(slot->lzo_mem != NULL);
} }
#endif #endif
/***********************************************************************//**
Try to get number of bytes per sector from file system.
@return file block size */
UNIV_INTERN
ulint
os_file_get_block_size(
/*===================*/
os_file_t file, /*!< in: handle to a file */
const char* name) /*!< in: file name */
{
ulint fblock_size = 512;
#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H)
struct statvfs fstat;
int err;
err = fstatvfs(file, &fstat);
if (err != 0) {
fprintf(stderr, "InnoDB: Warning: fstatvfs() failed on file %s\n", name);
os_file_handle_error_no_exit(name, "fstatvfs()", FALSE, __FILE__, __LINE__);
} else {
fblock_size = fstat.f_bsize;
}
#endif /* UNIV_LINUX */
#ifdef __WIN__
{
DWORD SectorsPerCluster = 0;
DWORD BytesPerSector = 0;
DWORD NumberOfFreeClusters = 0;
DWORD TotalNumberOfClusters = 0;
if (GetFreeSpace((LPCTSTR)name, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters)) {
fblock_size = BytesPerSector;
fprintf(stderr, "InnoDB: [Note]: Using %ld file block size\n", fblock_size);
} else {
fprintf(stderr, "InnoDB: Warning: GetFreeSpace() failed on file %s\n", name);
os_file_handle_error_no_exit(name, "GetFreeSpace()", FALSE, __FILE__, __LINE__);
}
}
#endif /* __WIN__*/
if (fblock_size > UNIV_PAGE_SIZE/2) {
fprintf(stderr, "InnoDB: Warning: File system for file %s has "
"file block size %lu not supported for page_size %lu\n",
name, fblock_size, UNIV_PAGE_SIZE);
fblock_size = UNIV_PAGE_SIZE/2;
fprintf(stderr, "InnoDB: Note: Using file block size %ld for file %s\n",
fblock_size, name);
}
return fblock_size;
}
...@@ -686,7 +686,7 @@ os_event_wait_time_low( ...@@ -686,7 +686,7 @@ os_event_wait_time_low(
tv.tv_usec += time_in_usec; tv.tv_usec += time_in_usec;
if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) { if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) {
tv.tv_sec += time_in_usec / MICROSECS_IN_A_SECOND; tv.tv_sec += tv.tv_usec / MICROSECS_IN_A_SECOND;
tv.tv_usec %= MICROSECS_IN_A_SECOND; tv.tv_usec %= MICROSECS_IN_A_SECOND;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2014, MariaDB Corporation
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -901,11 +902,36 @@ static monitor_info_t innodb_counter_info[] = ...@@ -901,11 +902,36 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512},
{"compress_trim_sect1024", "compression",
"Number of sect-1024 TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024},
{"compress_trim_sect2048", "compression",
"Number of sect-2048 TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048},
{"compress_trim_sect4096", "compression", {"compress_trim_sect4096", "compression",
"Number of sect-4K TRIMed by page compression", "Number of sect-4K TRIMed by page compression",
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096},
{"compress_trim_sect8192", "compression",
"Number of sect-8K TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192},
{"compress_trim_sect16384", "compression",
"Number of sect-16K TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384},
{"compress_trim_sect32768", "compression",
"Number of sect-32K TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768},
{"compress_pages_page_compressed", "compression", {"compress_pages_page_compressed", "compression",
"Number of pages compressed by page compression", "Number of pages compressed by page compression",
MONITOR_NONE, MONITOR_NONE,
...@@ -1861,9 +1887,24 @@ srv_mon_process_existing_counter( ...@@ -1861,9 +1887,24 @@ srv_mon_process_existing_counter(
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512: case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512:
value = srv_stats.page_compression_trim_sect512; value = srv_stats.page_compression_trim_sect512;
break; break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024:
value = srv_stats.page_compression_trim_sect1024;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048:
value = srv_stats.page_compression_trim_sect2048;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096: case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096:
value = srv_stats.page_compression_trim_sect4096; value = srv_stats.page_compression_trim_sect4096;
break; break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192:
value = srv_stats.page_compression_trim_sect8192;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384:
value = srv_stats.page_compression_trim_sect16384;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768:
value = srv_stats.page_compression_trim_sect32768;
break;
case MONITOR_OVLD_PAGES_PAGE_COMPRESSED: case MONITOR_OVLD_PAGES_PAGE_COMPRESSED:
value = srv_stats.pages_page_compressed; value = srv_stats.pages_page_compressed;
break; break;
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. Copyright (c) 2013, 2014, MariaDB Corporation. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -179,6 +179,7 @@ struct fil_node_t { ...@@ -179,6 +179,7 @@ struct fil_node_t {
ib_int64_t flush_counter;/*!< up to what ib_int64_t flush_counter;/*!< up to what
modification_counter value we have modification_counter value we have
flushed the modifications to disk */ flushed the modifications to disk */
ulint file_block_size;/*!< file system block size */
UT_LIST_NODE_T(fil_node_t) chain; UT_LIST_NODE_T(fil_node_t) chain;
/*!< link field for the file chain */ /*!< link field for the file chain */
UT_LIST_NODE_T(fil_node_t) LRU; UT_LIST_NODE_T(fil_node_t) LRU;
...@@ -779,6 +780,8 @@ fil_node_open_file( ...@@ -779,6 +780,8 @@ fil_node_open_file(
size_bytes = os_file_get_size(node->handle); size_bytes = os_file_get_size(node->handle);
ut_a(size_bytes != (os_offset_t) -1); ut_a(size_bytes != (os_offset_t) -1);
node->file_block_size = os_file_get_block_size(node->handle, node->name);
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
if (space->id == 0) { if (space->id == 0) {
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
...@@ -927,6 +930,10 @@ add_size: ...@@ -927,6 +930,10 @@ add_size:
&ret, atomic_writes); &ret, atomic_writes);
} }
if (node->file_block_size == 0) {
node->file_block_size = os_file_get_block_size(node->handle, node->name);
}
ut_a(ret); ut_a(ret);
node->open = TRUE; node->open = TRUE;
...@@ -5221,6 +5228,11 @@ retry: ...@@ -5221,6 +5228,11 @@ retry:
start_page_no = space->size; start_page_no = space->size;
file_start_page_no = space->size - node->size; file_start_page_no = space->size - node->size;
/* Determine correct file block size */
if (node->file_block_size == 0) {
node->file_block_size = os_file_get_block_size(node->handle, node->name);
}
#ifdef HAVE_POSIX_FALLOCATE #ifdef HAVE_POSIX_FALLOCATE
if (srv_use_posix_fallocate) { if (srv_use_posix_fallocate) {
os_offset_t start_offset = start_page_no * page_size; os_offset_t start_offset = start_page_no * page_size;
...@@ -6853,36 +6865,47 @@ fil_get_page_type_name( ...@@ -6853,36 +6865,47 @@ fil_get_page_type_name(
{ {
switch(page_type) { switch(page_type) {
case FIL_PAGE_PAGE_COMPRESSED: case FIL_PAGE_PAGE_COMPRESSED:
return "PAGE_COMPRESSED"; return (const char*)"PAGE_COMPRESSED";
case FIL_PAGE_INDEX: case FIL_PAGE_INDEX:
return "INDEX"; return (const char*)"INDEX";
case FIL_PAGE_UNDO_LOG: case FIL_PAGE_UNDO_LOG:
return "UNDO LOG"; return (const char*)"UNDO LOG";
case FIL_PAGE_INODE: case FIL_PAGE_INODE:
return "INODE"; return (const char*)"INODE";
case FIL_PAGE_IBUF_FREE_LIST: case FIL_PAGE_IBUF_FREE_LIST:
return "IBUF_FREE_LIST"; return (const char*)"IBUF_FREE_LIST";
case FIL_PAGE_TYPE_ALLOCATED: case FIL_PAGE_TYPE_ALLOCATED:
return "ALLOCATED"; return (const char*)"ALLOCATED";
case FIL_PAGE_IBUF_BITMAP: case FIL_PAGE_IBUF_BITMAP:
return "IBUF_BITMAP"; return (const char*)"IBUF_BITMAP";
case FIL_PAGE_TYPE_SYS: case FIL_PAGE_TYPE_SYS:
return "SYS"; return (const char*)"SYS";
case FIL_PAGE_TYPE_TRX_SYS: case FIL_PAGE_TYPE_TRX_SYS:
return "TRX_SYS"; return (const char*)"TRX_SYS";
case FIL_PAGE_TYPE_FSP_HDR: case FIL_PAGE_TYPE_FSP_HDR:
return "FSP_HDR"; return (const char*)"FSP_HDR";
case FIL_PAGE_TYPE_XDES: case FIL_PAGE_TYPE_XDES:
return "XDES"; return (const char*)"XDES";
case FIL_PAGE_TYPE_BLOB: case FIL_PAGE_TYPE_BLOB:
return "BLOB"; return (const char*)"BLOB";
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
return "ZBLOB"; return (const char*)"ZBLOB";
case FIL_PAGE_TYPE_ZBLOB2: case FIL_PAGE_TYPE_ZBLOB2:
return "ZBLOB2"; return (const char*)"ZBLOB2";
case FIL_PAGE_TYPE_COMPRESSED: case FIL_PAGE_TYPE_COMPRESSED:
return "ORACLE PAGE COMPRESSED"; return (const char*)"ORACLE PAGE COMPRESSED";
default: default:
return "PAGE TYPE CORRUPTED"; return (const char*)"PAGE TYPE CORRUPTED";
} }
} }
/****************************************************************//**
Get block size from fil node
@return block size*/
ulint
fil_node_get_block_size(
/*====================*/
fil_node_t* node) /*!< in: Node where to get block
size */
{
return (node->file_block_size);
}
...@@ -260,6 +260,7 @@ fil_compress_page( ...@@ -260,6 +260,7 @@ fil_compress_page(
byte* out_buf, /*!< out: compressed buffer */ byte* out_buf, /*!< out: compressed buffer */
ulint len, /*!< in: length of input buffer.*/ ulint len, /*!< in: length of input buffer.*/
ulint compression_level, /* in: compression level */ ulint compression_level, /* in: compression level */
ulint block_size, /*!< in: block size */
ulint* out_len, /*!< out: actual length of compressed ulint* out_len, /*!< out: actual length of compressed
page */ page */
byte* lzo_mem) /*!< in: temporal memory used by LZO */ byte* lzo_mem) /*!< in: temporal memory used by LZO */
...@@ -450,12 +451,11 @@ fil_compress_page( ...@@ -450,12 +451,11 @@ fil_compress_page(
write_size+=header_len; write_size+=header_len;
#define SECT_SIZE 512
/* Actual write needs to be alligned on block size */ /* Actual write needs to be alligned on block size */
if (write_size % SECT_SIZE) { if (write_size % block_size) {
write_size = (write_size + SECT_SIZE-1) & ~(SECT_SIZE-1); ut_a(block_size > 0);
ut_a((write_size % SECT_SIZE) == 0); write_size = (write_size + block_size-1) & ~(block_size-1);
ut_a((write_size % block_size) == 0);
} }
#ifdef UNIV_PAGECOMPRESS_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
......
...@@ -93,6 +93,7 @@ fil_compress_page( ...@@ -93,6 +93,7 @@ fil_compress_page(
byte* out_buf, /*!< out: compressed buffer */ byte* out_buf, /*!< out: compressed buffer */
ulint len, /*!< in: length of input buffer.*/ ulint len, /*!< in: length of input buffer.*/
ulint compression_level, /*!< in: compression level */ ulint compression_level, /*!< in: compression level */
ulint block_size, /*!< in: block size */
ulint* out_len, /*!< out: actual length of compressed ulint* out_len, /*!< out: actual length of compressed
page */ page */
byte* lzo_mem); /*!< in: temporal memory used by LZO */ byte* lzo_mem); /*!< in: temporal memory used by LZO */
...@@ -119,6 +120,13 @@ fil_node_get_space_id( ...@@ -119,6 +120,13 @@ fil_node_get_space_id(
/*==================*/ /*==================*/
fil_node_t* node); /*!< in: Node where to get space id*/ fil_node_t* node); /*!< in: Node where to get space id*/
/****************************************************************//**
Get block size from fil node
@return block size*/
ulint
fil_node_get_block_size(
fil_node_t* node); /*!< in: Node where to get block
size */
/*******************************************************************//** /*******************************************************************//**
Find out wheather the page is page compressed Find out wheather the page is page compressed
@return true if page is page compressed*/ @return true if page is page compressed*/
......
...@@ -1374,6 +1374,16 @@ os_file_handle_error_no_exit( ...@@ -1374,6 +1374,16 @@ os_file_handle_error_no_exit(
any message to the log. */ any message to the log. */
/***********************************************************************//**
Try to get number of bytes per sector from file system.
@return file block size */
UNIV_INTERN
ulint
os_file_get_block_size(
/*===================*/
os_file_t file, /*!< in: handle to a file */
const char* name); /*!< in: file name */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "os0file.ic" #include "os0file.ic"
#endif #endif
......
...@@ -311,7 +311,12 @@ enum monitor_id_t { ...@@ -311,7 +311,12 @@ enum monitor_id_t {
/* New monitor variables for page compression */ /* New monitor variables for page compression */
MONITOR_OVLD_PAGE_COMPRESS_SAVED, MONITOR_OVLD_PAGE_COMPRESS_SAVED,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384,
MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768,
MONITOR_OVLD_PAGES_PAGE_COMPRESSED, MONITOR_OVLD_PAGES_PAGE_COMPRESSED,
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP,
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED,
......
...@@ -107,8 +107,18 @@ struct srv_stats_t { ...@@ -107,8 +107,18 @@ struct srv_stats_t {
ulint_ctr_64_t page_compression_saved; ulint_ctr_64_t page_compression_saved;
/** Number of 512Byte TRIM by page compression */ /** Number of 512Byte TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect512; ulint_ctr_64_t page_compression_trim_sect512;
/** Number of 1K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect1024;
/** Number of 2K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect2048;
/** Number of 4K TRIM by page compression */ /** Number of 4K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect4096; ulint_ctr_64_t page_compression_trim_sect4096;
/** Number of 8K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect8192;
/** Number of 16K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect16384;
/** Number of 32K TRIM by page compression */
ulint_ctr_64_t page_compression_trim_sect32768;
/* Number of index pages written */ /* Number of index pages written */
ulint_ctr_64_t index_pages_written; ulint_ctr_64_t index_pages_written;
/* Number of non index pages written */ /* Number of non index pages written */
...@@ -1144,8 +1154,18 @@ struct export_var_t{ ...@@ -1144,8 +1154,18 @@ struct export_var_t{
by page compression */ by page compression */
ib_int64_t innodb_page_compression_trim_sect512;/*!< Number of 512b TRIM ib_int64_t innodb_page_compression_trim_sect512;/*!< Number of 512b TRIM
by page compression */ by page compression */
ib_int64_t innodb_page_compression_trim_sect1024;/*!< Number of 1K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect2048;/*!< Number of 2K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect4096;/*!< Number of 4K byte TRIM ib_int64_t innodb_page_compression_trim_sect4096;/*!< Number of 4K byte TRIM
by page compression */ by page compression */
ib_int64_t innodb_page_compression_trim_sect8192;/*!< Number of 8K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect16384;/*!< Number of 16K TRIM
by page compression */
ib_int64_t innodb_page_compression_trim_sect32768;/*!< Number of 32K TRIM
by page compression */
ib_int64_t innodb_index_pages_written; /*!< Number of index pages ib_int64_t innodb_index_pages_written; /*!< Number of index pages
written */ written */
ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. Copyright (c) 2013, 2014, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted Portions of this file contain modifications contributed and copyrighted
by Percona Inc.. Those modifications are by Percona Inc.. Those modifications are
...@@ -79,6 +79,10 @@ Created 10/21/1995 Heikki Tuuri ...@@ -79,6 +79,10 @@ Created 10/21/1995 Heikki Tuuri
# endif # endif
#endif #endif
#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
#ifdef HAVE_LZO #ifdef HAVE_LZO
#include "lzo/lzo1x.h" #include "lzo/lzo1x.h"
#endif #endif
...@@ -233,6 +237,10 @@ struct os_aio_slot_t{ ...@@ -233,6 +237,10 @@ struct os_aio_slot_t{
free this */ free this */
ibool page_compress_success; ibool page_compress_success;
/*!< TRUE if page compression was
successfull, false if not */
ulint file_block_size;/*!< file block size */
#ifdef LINUX_NATIVE_AIO #ifdef LINUX_NATIVE_AIO
struct iocb control; /* Linux control block for aio */ struct iocb control; /* Linux control block for aio */
...@@ -354,9 +362,7 @@ UNIV_INTERN ...@@ -354,9 +362,7 @@ UNIV_INTERN
ibool ibool
os_file_trim( os_file_trim(
/*=========*/ /*=========*/
os_file_t file, /*!< in: file to be trimmed */ os_aio_slot_t* slot); /*!< in: slot structure */
os_aio_slot_t* slot, /*!< in: slot structure */
ulint len); /*!< in: length of area */
/**********************************************************************//** /**********************************************************************//**
Allocate memory for temporal buffer used for page compression. This Allocate memory for temporal buffer used for page compression. This
...@@ -4731,6 +4737,7 @@ found: ...@@ -4731,6 +4737,7 @@ found:
slot->write_size = write_size; slot->write_size = write_size;
slot->page_compression_level = page_compression_level; slot->page_compression_level = page_compression_level;
slot->page_compression = page_compression; slot->page_compression = page_compression;
slot->file_block_size = fil_node_get_block_size(message1);
/* If the space is page compressed and this is write operation /* If the space is page compressed and this is write operation
then we compress the page */ then we compress the page */
...@@ -4759,6 +4766,7 @@ found: ...@@ -4759,6 +4766,7 @@ found:
slot->page_buf, slot->page_buf,
len, len,
page_compression_level, page_compression_level,
fil_node_get_block_size(slot->message1),
&real_len, &real_len,
slot->lzo_mem slot->lzo_mem
); );
...@@ -5407,7 +5415,7 @@ os_aio_windows_handle( ...@@ -5407,7 +5415,7 @@ os_aio_windows_handle(
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) {
// Deallocate unused blocks from file system // Deallocate unused blocks from file system
os_file_trim(slot->file, slot, slot->len); os_file_trim(slot);
} }
} }
} }
...@@ -5525,7 +5533,7 @@ retry: ...@@ -5525,7 +5533,7 @@ retry:
ut_ad(slot->page_compression_page); ut_ad(slot->page_compression_page);
if (srv_use_trim && os_fallocate_failed == FALSE) { if (srv_use_trim && os_fallocate_failed == FALSE) {
// Deallocate unused blocks from file system // Deallocate unused blocks from file system
os_file_trim(slot->file, slot, slot->len); os_file_trim(slot);
} }
} }
} }
...@@ -6436,17 +6444,17 @@ UNIV_INTERN ...@@ -6436,17 +6444,17 @@ UNIV_INTERN
ibool ibool
os_file_trim( os_file_trim(
/*=========*/ /*=========*/
os_file_t file, /*!< in: file to be trimmed */ os_aio_slot_t* slot) /*!< in: slot structure */
os_aio_slot_t* slot, /*!< in: slot structure */
ulint len) /*!< in: length of area */
{ {
size_t len = slot->len;
#define SECT_SIZE 512 size_t trim_len = UNIV_PAGE_SIZE - slot->len;
size_t trim_len = UNIV_PAGE_SIZE - len;
os_offset_t off __attribute__((unused)) = slot->offset + len; os_offset_t off __attribute__((unused)) = slot->offset + len;
size_t bsize = slot->file_block_size;
// len here should be alligned to sector size // len here should be alligned to sector size
ut_a((trim_len % SECT_SIZE) == 0); ut_ad((trim_len % bsize) == 0);
ut_a((len % SECT_SIZE) == 0); ut_ad((len % bsize) == 0);
ut_ad(bsize != 0);
// Nothing to do if trim length is zero or if actual write // Nothing to do if trim length is zero or if actual write
// size is initialized and it is smaller than current write size. // size is initialized and it is smaller than current write size.
...@@ -6476,7 +6484,7 @@ os_file_trim( ...@@ -6476,7 +6484,7 @@ os_file_trim(
#ifdef __linux__ #ifdef __linux__
#if defined(FALLOC_FL_PUNCH_HOLE) && defined (FALLOC_FL_KEEP_SIZE) #if defined(FALLOC_FL_PUNCH_HOLE) && defined (FALLOC_FL_KEEP_SIZE)
int ret = fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len); int ret = fallocate(slot->file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len);
if (ret) { if (ret) {
/* After first failure do not try to trim again */ /* After first failure do not try to trim again */
...@@ -6520,7 +6528,8 @@ os_file_trim( ...@@ -6520,7 +6528,8 @@ os_file_trim(
flt.Ranges[0].Offset = off; flt.Ranges[0].Offset = off;
flt.Ranges[0].Length = trim_len; flt.Ranges[0].Length = trim_len;
BOOL ret = DeviceIoControl(file,FSCTL_FILE_LEVEL_TRIM,&flt, sizeof(flt), NULL, NULL, NULL, NULL); BOOL ret = DeviceIoControl(slot->file, FSCTL_FILE_LEVEL_TRIM,
&flt, sizeof(flt), NULL, NULL, NULL, NULL);
if (!ret) { if (!ret) {
/* After first failure do not try to trim again */ /* After first failure do not try to trim again */
...@@ -6546,8 +6555,32 @@ os_file_trim( ...@@ -6546,8 +6555,32 @@ os_file_trim(
} }
#endif #endif
srv_stats.page_compression_trim_sect512.add((trim_len / SECT_SIZE)); switch(bsize) {
srv_stats.page_compression_trim_sect4096.add((trim_len / (SECT_SIZE*8))); case 512:
srv_stats.page_compression_trim_sect512.add((trim_len / bsize));
break;
case 1024:
srv_stats.page_compression_trim_sect1024.add((trim_len / bsize));
break;
case 2948:
srv_stats.page_compression_trim_sect2048.add((trim_len / bsize));
break;
case 4096:
srv_stats.page_compression_trim_sect4096.add((trim_len / bsize));
break;
case 8192:
srv_stats.page_compression_trim_sect8192.add((trim_len / bsize));
break;
case 16384:
srv_stats.page_compression_trim_sect16384.add((trim_len / bsize));
break;
case 32768:
srv_stats.page_compression_trim_sect32768.add((trim_len / bsize));
break;
default:
break;
}
srv_stats.page_compressed_trim_op.inc(); srv_stats.page_compressed_trim_op.inc();
return (TRUE); return (TRUE);
...@@ -6590,3 +6623,57 @@ os_slot_alloc_lzo_mem( ...@@ -6590,3 +6623,57 @@ os_slot_alloc_lzo_mem(
ut_a(slot->lzo_mem != NULL); ut_a(slot->lzo_mem != NULL);
} }
#endif #endif
/***********************************************************************//**
Try to get number of bytes per sector from file system.
@return file block size */
UNIV_INTERN
ulint
os_file_get_block_size(
/*===================*/
os_file_t file, /*!< in: handle to a file */
const char* name) /*!< in: file name */
{
ulint fblock_size = 512;
#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H)
struct statvfs fstat;
int err;
err = fstatvfs(file, &fstat);
if (err != 0) {
fprintf(stderr, "InnoDB: Warning: fstatvfs() failed on file %s\n", name);
os_file_handle_error_no_exit(name, "fstatvfs()", FALSE, __FILE__, __LINE__);
} else {
fblock_size = fstat.f_bsize;
}
#endif /* UNIV_LINUX */
#ifdef __WIN__
{
DWORD SectorsPerCluster = 0;
DWORD BytesPerSector = 0;
DWORD NumberOfFreeClusters = 0;
DWORD TotalNumberOfClusters = 0;
if (GetFreeSpace((LPCTSTR)name, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters)) {
fblock_size = BytesPerSector;
fprintf(stderr, "InnoDB: [Note]: Using %ld file block size\n", fblock_size);
} else {
fprintf(stderr, "InnoDB: Warning: GetFreeSpace() failed on file %s\n", name);
os_file_handle_error_no_exit(name, "GetFreeSpace()", FALSE, __FILE__, __LINE__);
}
}
#endif /* __WIN__*/
if (fblock_size > UNIV_PAGE_SIZE/2) {
fprintf(stderr, "InnoDB: Warning: File system for file %s has "
"file block size %lu not supported for page_size %lu\n",
name, fblock_size, UNIV_PAGE_SIZE);
fblock_size = UNIV_PAGE_SIZE/2;
fprintf(stderr, "InnoDB: Note: Using file block size %ld for file %s\n",
fblock_size, name);
}
return fblock_size;
}
...@@ -686,7 +686,7 @@ os_event_wait_time_low( ...@@ -686,7 +686,7 @@ os_event_wait_time_low(
tv.tv_usec += time_in_usec; tv.tv_usec += time_in_usec;
if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) { if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) {
tv.tv_sec += time_in_usec / MICROSECS_IN_A_SECOND; tv.tv_sec += tv.tv_usec / MICROSECS_IN_A_SECOND;
tv.tv_usec %= MICROSECS_IN_A_SECOND; tv.tv_usec %= MICROSECS_IN_A_SECOND;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2014, MariaDB Corporation
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -901,11 +902,36 @@ static monitor_info_t innodb_counter_info[] = ...@@ -901,11 +902,36 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512},
{"compress_trim_sect1024", "compression",
"Number of sect-1024 TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024},
{"compress_trim_sect2048", "compression",
"Number of sect-2048 TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048},
{"compress_trim_sect4096", "compression", {"compress_trim_sect4096", "compression",
"Number of sect-4K TRIMed by page compression", "Number of sect-4K TRIMed by page compression",
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096},
{"compress_trim_sect8192", "compression",
"Number of sect-8K TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192},
{"compress_trim_sect16384", "compression",
"Number of sect-16K TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384},
{"compress_trim_sect32768", "compression",
"Number of sect-32K TRIMed by page compression",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768},
{"compress_pages_page_compressed", "compression", {"compress_pages_page_compressed", "compression",
"Number of pages compressed by page compression", "Number of pages compressed by page compression",
MONITOR_NONE, MONITOR_NONE,
...@@ -1861,9 +1887,24 @@ srv_mon_process_existing_counter( ...@@ -1861,9 +1887,24 @@ srv_mon_process_existing_counter(
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512: case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512:
value = srv_stats.page_compression_trim_sect512; value = srv_stats.page_compression_trim_sect512;
break; break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024:
value = srv_stats.page_compression_trim_sect1024;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048:
value = srv_stats.page_compression_trim_sect2048;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096: case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096:
value = srv_stats.page_compression_trim_sect4096; value = srv_stats.page_compression_trim_sect4096;
break; break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192:
value = srv_stats.page_compression_trim_sect8192;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384:
value = srv_stats.page_compression_trim_sect16384;
break;
case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768:
value = srv_stats.page_compression_trim_sect32768;
break;
case MONITOR_OVLD_PAGES_PAGE_COMPRESSED: case MONITOR_OVLD_PAGES_PAGE_COMPRESSED:
value = srv_stats.pages_page_compressed; value = srv_stats.pages_page_compressed;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment