diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 3678442417a..cee9c7e0534 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -5487,6 +5487,8 @@ fil_io( srv_stats.data_written.add(len); if (fil_page_is_index_page((byte *)buf)) { srv_stats.index_pages_written.inc(); + } else { + srv_stats.non_index_pages_written.inc(); } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 1273a25a5f5..b790ae76121 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -711,6 +711,8 @@ static SHOW_VAR innodb_status_variables[]= { (char*) &export_vars.innodb_page_compression_trim_sect4096, SHOW_LONGLONG}, {"num_index_pages_written", (char*) &export_vars.innodb_index_pages_written, SHOW_LONGLONG}, + {"num_non_index_pages_written", + (char*) &export_vars.innodb_non_index_pages_written, SHOW_LONGLONG}, {"num_pages_page_compressed", (char*) &export_vars.innodb_pages_page_compressed, SHOW_LONGLONG}, {"num_page_compressed_trim_op", @@ -16786,18 +16788,6 @@ static MYSQL_SYSVAR_BOOL(trx_purge_view_update_only_debug, NULL, NULL, FALSE); #endif /* UNIV_DEBUG */ -/* -static MYSQL_SYSVAR_LONG(trim_pct, srv_trim_pct, - PLUGIN_VAR_OPCMDARG , - "How many percent of compressed pages should be trimmed", - NULL, NULL, 100, 0, 100, 0); -*/ - -static MYSQL_SYSVAR_BOOL(compress_index_pages, srv_page_compress_index_pages, - PLUGIN_VAR_OPCMDARG, - "Use page compression also for index pages. Default FALSE.", - NULL, NULL, FALSE); - static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim, PLUGIN_VAR_OPCMDARG, "Use trim. Default FALSE.", @@ -16976,8 +16966,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(limit_optimistic_insert_debug), MYSQL_SYSVAR(trx_purge_view_update_only_debug), #endif /* UNIV_DEBUG */ - // MYSQL_SYSVAR(trim_pct), - MYSQL_SYSVAR(compress_index_pages), MYSQL_SYSVAR(use_trim), #ifdef HAVE_LZ4 MYSQL_SYSVAR(use_lz4), diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index d7c2d6ce531..4d0379a2643 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -165,6 +165,7 @@ enum monitor_id_t { MONITOR_OVLD_PAGE_CREATED, MONITOR_OVLD_PAGES_WRITTEN, MONITOR_OVLD_INDEX_PAGES_WRITTEN, + MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN, MONITOR_OVLD_PAGES_READ, MONITOR_OVLD_BYTE_READ, MONITOR_OVLD_BYTE_WRITTEN, diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index b4bb9c09ef6..ac264a7d597 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -111,6 +111,8 @@ struct srv_stats_t { ulint_ctr_64_t page_compression_trim_sect4096; /* Number of index pages written */ ulint_ctr_64_t index_pages_written; + /* Number of non index pages written */ + ulint_ctr_64_t non_index_pages_written; /* Number of pages compressed with page compression */ ulint_ctr_64_t pages_page_compressed; /* Number of TRIM operations induced by page compression */ @@ -236,12 +238,6 @@ use simulated aio we build below with threads. Currently we support native aio on windows and linux */ extern my_bool srv_use_native_aio; -/* Is page compression used only for index pages */ -extern my_bool srv_page_compress_index_pages; - -/* Frequency of trim operations */ -extern long srv_trim_pct; - /* Use trim operation */ extern my_bool srv_use_trim; @@ -901,6 +897,8 @@ struct export_var_t{ by page compression */ ib_int64_t innodb_index_pages_written; /*!< Number of index pages written */ + ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages + written */ ib_int64_t innodb_pages_page_compressed;/*!< Number of pages compressed by page compression */ ib_int64_t innodb_page_compressed_trim_op;/*!< Number of TRIM operations diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 0093dd8e266..09340cca68d 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -4464,12 +4464,8 @@ found: slot->page_compression = page_compression; /* If the space is page compressed and this is write operation - 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 == true || !fil_page_is_index_page(slot->buf))) { + then we compress the page */ + if (message1 && type == OS_FILE_WRITE && page_compression ) { ulint real_len = len; byte* tmp = NULL; diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 8ba0b977c98..32171182cf9 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -296,6 +296,12 @@ static monitor_info_t innodb_counter_info[] = MONITOR_EXISTING | MONITOR_DEFAULT_ON), MONITOR_DEFAULT_START, MONITOR_OVLD_INDEX_PAGES_WRITTEN}, + {"buffer_non_index_pages_written", "buffer", + "Number of non index pages written (innodb_non_index_pages_written)", + static_cast( + MONITOR_EXISTING | MONITOR_DEFAULT_ON), + MONITOR_DEFAULT_START, MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN}, + {"buffer_pages_read", "buffer", "Number of pages read (innodb_pages_read)", static_cast( @@ -1593,11 +1599,16 @@ srv_mon_process_existing_counter( value = stat.n_pages_written; break; - /* innodb_index_pages_written, the number of page written */ + /* innodb_index_pages_written, the number of index pages written */ case MONITOR_OVLD_INDEX_PAGES_WRITTEN: value = srv_stats.index_pages_written; break; + /* innodb_non_index_pages_written, the number of non index pages written */ + case MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN: + value = srv_stats.non_index_pages_written; + break; + /* innodb_pages_read */ case MONITOR_OVLD_PAGES_READ: buf_get_total_stat(&stat); diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index dcef4a03b76..fe3af72e150 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -146,10 +146,6 @@ use simulated aio we build below with threads. Currently we support native aio on windows and linux */ 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 = FALSE; -UNIV_INTERN long srv_trim_pct = 100; /* If this flag is TRUE, then we will use fallocate(PUCH_HOLE) to the pages */ UNIV_INTERN my_bool srv_use_trim = FALSE; @@ -393,6 +389,7 @@ UNIV_INTERN ib_uint64_t srv_page_compression_saved = 0; UNIV_INTERN ib_uint64_t srv_page_compression_trim_sect512 = 0; UNIV_INTERN ib_uint64_t srv_page_compression_trim_sect4096 = 0; UNIV_INTERN ib_uint64_t srv_index_pages_written = 0; +UNIV_INTERN ib_uint64_t srv_non_index_pages_written = 0; UNIV_INTERN ib_uint64_t srv_pages_page_compressed = 0; UNIV_INTERN ib_uint64_t srv_page_compressed_trim_op = 0; UNIV_INTERN ib_uint64_t srv_page_compressed_trim_op_saved = 0; @@ -1485,6 +1482,7 @@ srv_export_innodb_status(void) export_vars.innodb_page_compression_trim_sect512 = srv_stats.page_compression_trim_sect512; export_vars.innodb_page_compression_trim_sect4096 = srv_stats.page_compression_trim_sect4096; export_vars.innodb_index_pages_written = srv_stats.index_pages_written; + export_vars.innodb_non_index_pages_written = srv_stats.non_index_pages_written; export_vars.innodb_pages_page_compressed = srv_stats.pages_page_compressed; export_vars.innodb_page_compressed_trim_op = srv_stats.page_compressed_trim_op; export_vars.innodb_page_compressed_trim_op_saved = srv_stats.page_compressed_trim_op_saved; diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index b38b80d9ef2..8e788e71983 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -5488,6 +5488,8 @@ _fil_io( srv_stats.data_written.add(len); if (fil_page_is_index_page((byte *)buf)) { srv_stats.index_pages_written.inc(); + } else { + srv_stats.non_index_pages_written.inc(); } } diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index fc92cc828f7..4436dc3d0e1 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -906,6 +906,8 @@ static SHOW_VAR innodb_status_variables[]= { (char*) &export_vars.innodb_page_compression_trim_sect4096, SHOW_LONGLONG}, {"num_index_pages_written", (char*) &export_vars.innodb_index_pages_written, SHOW_LONGLONG}, + {"num_non_index_pages_written", + (char*) &export_vars.innodb_non_index_pages_written, SHOW_LONGLONG}, {"num_pages_page_compressed", (char*) &export_vars.innodb_pages_page_compressed, SHOW_LONGLONG}, {"num_page_compressed_trim_op", @@ -17934,24 +17936,12 @@ static MYSQL_SYSVAR_BOOL(use_stacktrace, srv_use_stacktrace, "Print stacktrace on long semaphore wait (off by default supported only on linux)", NULL, NULL, FALSE); -/* -static MYSQL_SYSVAR_LONG(trim_pct, srv_trim_pct, - PLUGIN_VAR_OPCMDARG , - "How many percent of compressed pages should be trimmed", - NULL, NULL, 100, 0, 100, 0); -*/ - static MYSQL_SYSVAR_UINT(compression_level, page_zip_level, PLUGIN_VAR_RQCMDARG, "Compression level used for zlib compression. 0 is no compression" ", 1 is fastest, 9 is best compression and default is 6.", NULL, NULL, DEFAULT_COMPRESSION_LEVEL, 0, 9, 0); -static MYSQL_SYSVAR_BOOL(compress_index_pages, srv_page_compress_index_pages, - PLUGIN_VAR_OPCMDARG, - "Use page compression also for index pages. Default FALSE.", - NULL, NULL, FALSE); - static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim, PLUGIN_VAR_OPCMDARG, "Use trim. Default FALSE.", @@ -18168,8 +18158,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(fake_changes), MYSQL_SYSVAR(locking_fake_changes), MYSQL_SYSVAR(use_stacktrace), - // MYSQL_SYSVAR(trim_pct), - MYSQL_SYSVAR(compress_index_pages), MYSQL_SYSVAR(use_trim), #ifdef HAVE_LZ4 MYSQL_SYSVAR(use_lz4), diff --git a/storage/xtradb/include/srv0mon.h b/storage/xtradb/include/srv0mon.h index 5e5de2c2e0f..10e1fa6188a 100644 --- a/storage/xtradb/include/srv0mon.h +++ b/storage/xtradb/include/srv0mon.h @@ -165,6 +165,7 @@ enum monitor_id_t { MONITOR_OVLD_PAGE_CREATED, MONITOR_OVLD_PAGES_WRITTEN, MONITOR_OVLD_INDEX_PAGES_WRITTEN, + MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN, MONITOR_OVLD_PAGES_READ, MONITOR_OVLD_BYTE_READ, MONITOR_OVLD_BYTE_WRITTEN, diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index 879989770e6..a532f90ec24 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -111,6 +111,8 @@ struct srv_stats_t { ulint_ctr_64_t page_compression_trim_sect4096; /* Number of index pages written */ ulint_ctr_64_t index_pages_written; + /* Number of non index pages written */ + ulint_ctr_64_t non_index_pages_written; /* Number of pages compressed with page compression */ ulint_ctr_64_t pages_page_compressed; /* Number of TRIM operations induced by page compression */ @@ -256,12 +258,6 @@ extern ibool srv_use_native_conditions; #endif /* __WIN__ */ #endif /* !UNIV_HOTBACKUP */ -/* Is page compression used only for index pages */ -extern my_bool srv_page_compress_index_pages; - -/* Frequency of trim operations */ -extern long srv_trim_pct; - /* Use trim operation */ extern my_bool srv_use_trim; @@ -1110,6 +1106,8 @@ struct export_var_t{ by page compression */ ib_int64_t innodb_index_pages_written; /*!< Number of index pages written */ + ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages + written */ ib_int64_t innodb_pages_page_compressed;/*!< Number of pages compressed by page compression */ ib_int64_t innodb_page_compressed_trim_op;/*!< Number of TRIM operations diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 525310025da..fc2f5d78c9a 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -4580,12 +4580,8 @@ found: slot->page_compression = page_compression; /* If the space is page compressed and this is write operation - 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 == true || !fil_page_is_index_page(slot->buf))) { + then we compress the page */ + if (message1 && type == OS_FILE_WRITE && page_compression ) { ulint real_len = len; byte* tmp = NULL; diff --git a/storage/xtradb/srv/srv0mon.cc b/storage/xtradb/srv/srv0mon.cc index 8ba0b977c98..32171182cf9 100644 --- a/storage/xtradb/srv/srv0mon.cc +++ b/storage/xtradb/srv/srv0mon.cc @@ -296,6 +296,12 @@ static monitor_info_t innodb_counter_info[] = MONITOR_EXISTING | MONITOR_DEFAULT_ON), MONITOR_DEFAULT_START, MONITOR_OVLD_INDEX_PAGES_WRITTEN}, + {"buffer_non_index_pages_written", "buffer", + "Number of non index pages written (innodb_non_index_pages_written)", + static_cast( + MONITOR_EXISTING | MONITOR_DEFAULT_ON), + MONITOR_DEFAULT_START, MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN}, + {"buffer_pages_read", "buffer", "Number of pages read (innodb_pages_read)", static_cast( @@ -1593,11 +1599,16 @@ srv_mon_process_existing_counter( value = stat.n_pages_written; break; - /* innodb_index_pages_written, the number of page written */ + /* innodb_index_pages_written, the number of index pages written */ case MONITOR_OVLD_INDEX_PAGES_WRITTEN: value = srv_stats.index_pages_written; break; + /* innodb_non_index_pages_written, the number of non index pages written */ + case MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN: + value = srv_stats.non_index_pages_written; + break; + /* innodb_pages_read */ case MONITOR_OVLD_PAGES_READ: buf_get_total_stat(&stat); diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index f1ee459efd7..386dbfddf0b 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -161,10 +161,6 @@ use simulated aio we build below with threads. Currently we support native aio on windows and linux */ 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 = 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*/ UNIV_INTERN long srv_compress_zlib_level = 6; @@ -515,6 +511,7 @@ UNIV_INTERN ib_uint64_t srv_page_compression_saved = 0; UNIV_INTERN ib_uint64_t srv_page_compression_trim_sect512 = 0; UNIV_INTERN ib_uint64_t srv_page_compression_trim_sect4096 = 0; UNIV_INTERN ib_uint64_t srv_index_pages_written = 0; +UNIV_INTERN ib_uint64_t srv_non_index_pages_written = 0; UNIV_INTERN ib_uint64_t srv_pages_page_compressed = 0; UNIV_INTERN ib_uint64_t srv_page_compressed_trim_op = 0; UNIV_INTERN ib_uint64_t srv_page_compressed_trim_op_saved = 0; @@ -1866,6 +1863,7 @@ srv_export_innodb_status(void) export_vars.innodb_page_compression_trim_sect512 = srv_stats.page_compression_trim_sect512; export_vars.innodb_page_compression_trim_sect4096 = srv_stats.page_compression_trim_sect4096; export_vars.innodb_index_pages_written = srv_stats.index_pages_written; + export_vars.innodb_non_index_pages_written = srv_stats.non_index_pages_written; export_vars.innodb_pages_page_compressed = srv_stats.pages_page_compressed; export_vars.innodb_page_compressed_trim_op = srv_stats.page_compressed_trim_op; export_vars.innodb_page_compressed_trim_op_saved = srv_stats.page_compressed_trim_op_saved;