Skip to content

Commit

Permalink
Changed so that innodb_compress_index pages means that if true also i…
Browse files Browse the repository at this point in the history
…ndex

pages are compressed if false index pages are not compressed.

Fixed small output error when page_compression_level was incorrectly
given.
  • Loading branch information
Jan Lindström committed Mar 7, 2014
1 parent 67cb55c commit c556b9d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
6 changes: 3 additions & 3 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9907,7 +9907,7 @@ ha_innobase::check_table_options(
HA_WRONG_CREATE_OPTION,
"InnoDB: invalid PAGE_COMPRESSION_LEVEL = %lu."
" Valid values are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]",
create_info->key_block_size);
options->page_compression_level);
return "PAGE_COMPRESSION_LEVEL";
}
}
Expand Down Expand Up @@ -16795,8 +16795,8 @@ static MYSQL_SYSVAR_LONG(trim_pct, srv_trim_pct,

static MYSQL_SYSVAR_BOOL(compress_index_pages, srv_page_compress_index_pages,
PLUGIN_VAR_OPCMDARG,
"Use page compression for only index pages. Default TRUE.",
NULL, NULL, TRUE);
"Use page compression also for index pages. Default FALSE.",
NULL, NULL, FALSE);

static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
PLUGIN_VAR_OPCMDARG,
Expand Down
8 changes: 3 additions & 5 deletions storage/innobase/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4464,14 +4464,12 @@ os_aio_array_reserve_slot(
slot->page_compression = page_compression;

/* If the space is page compressed and this is write operation
and if either only index pages compression is disabled or
page is index page and only index pages compression is enabled then
we compress the page */
and either index compression is enabled or page is not a index
page then we compress the page */
if (message1 &&
type == OS_FILE_WRITE &&
page_compression &&
(srv_page_compress_index_pages == false ||
(srv_page_compress_index_pages == true && fil_page_is_index_page(slot->buf)))) {
(srv_page_compress_index_pages == true || !fil_page_is_index_page(slot->buf))) {
ulint real_len = len;
byte* tmp = NULL;

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ UNIV_INTERN my_bool srv_use_native_aio = TRUE;

/* If this flag is TRUE, then we will use page compression
only for index pages */
UNIV_INTERN my_bool srv_page_compress_index_pages = TRUE;
UNIV_INTERN my_bool srv_page_compress_index_pages = FALSE;
UNIV_INTERN long srv_trim_pct = 100;
/* If this flag is TRUE, then we will use fallocate(PUCH_HOLE)
to the pages */
Expand Down
6 changes: 3 additions & 3 deletions storage/xtradb/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10420,7 +10420,7 @@ ha_innobase::check_table_options(
HA_WRONG_CREATE_OPTION,
"InnoDB: invalid PAGE_COMPRESSION_LEVEL = %lu."
" Valid values are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]",
create_info->key_block_size);
options->page_compression_level);
return "PAGE_COMPRESSION_LEVEL";
}
}
Expand Down Expand Up @@ -17949,8 +17949,8 @@ static MYSQL_SYSVAR_UINT(compression_level, page_zip_level,

static MYSQL_SYSVAR_BOOL(compress_index_pages, srv_page_compress_index_pages,
PLUGIN_VAR_OPCMDARG,
"Use page compression for only index pages. Default TRUE.",
NULL, NULL, TRUE);
"Use page compression also for index pages. Default FALSE.",
NULL, NULL, FALSE);

static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
PLUGIN_VAR_OPCMDARG,
Expand Down
8 changes: 3 additions & 5 deletions storage/xtradb/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4580,14 +4580,12 @@ os_aio_array_reserve_slot(
slot->page_compression = page_compression;

/* If the space is page compressed and this is write operation
and if either only index pages compression is disabled or
page is index page and only index pages compression is enabled then
we compress the page */
and either index compression is enabled or page is not a index
page then we compress the page */
if (message1 &&
type == OS_FILE_WRITE &&
page_compression &&
(srv_page_compress_index_pages == false ||
(srv_page_compress_index_pages == true && fil_page_is_index_page(slot->buf)))) {
(srv_page_compress_index_pages == true || !fil_page_is_index_page(slot->buf))) {
ulint real_len = len;
byte* tmp = NULL;

Expand Down
2 changes: 1 addition & 1 deletion storage/xtradb/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ UNIV_INTERN my_bool srv_use_native_aio = TRUE;

/* If this flag is TRUE, then we will use page compression
only for index pages */
UNIV_INTERN my_bool srv_page_compress_index_pages = TRUE;
UNIV_INTERN my_bool srv_page_compress_index_pages = FALSE;
UNIV_INTERN long srv_trim_pct = 100;
/* Default compression level if page compression is used and no compression
level is set for the table*/
Expand Down

0 comments on commit c556b9d

Please sign in to comment.