Commit e15454c5 authored by marko's avatar marko

Merge a change from MySQL AB:

ChangeSet@1.2409.1.83  2007-03-06 10:36:15-07:00  tsmith@hindu.god
Bug #26598: Create variable to allow turning off of statistic gathering
on metadata commands

Add innodb_stats_on_metadata option, which enables gathering
index statistics when processing metadata commands such as
SHOW TABLE STATUS.  Default behavior of the server does not
change (this option is enabled by default).
parent fb71bad6
...@@ -129,6 +129,7 @@ my_bool innobase_file_per_table = FALSE; ...@@ -129,6 +129,7 @@ my_bool innobase_file_per_table = FALSE;
my_bool innobase_locks_unsafe_for_binlog = FALSE; my_bool innobase_locks_unsafe_for_binlog = FALSE;
my_bool innobase_rollback_on_timeout = FALSE; my_bool innobase_rollback_on_timeout = FALSE;
my_bool innobase_create_status_file = FALSE; my_bool innobase_create_status_file = FALSE;
my_bool innobase_stats_on_metadata = TRUE;
static char *internal_innobase_data_file_path = NULL; static char *internal_innobase_data_file_path = NULL;
...@@ -1651,6 +1652,8 @@ innobase_init(void *p) ...@@ -1651,6 +1652,8 @@ innobase_init(void *p)
srv_max_n_open_files = (ulint) innobase_open_files; srv_max_n_open_files = (ulint) innobase_open_files;
srv_innodb_status = (ibool) innobase_create_status_file; srv_innodb_status = (ibool) innobase_create_status_file;
srv_stats_on_metadata = (ibool) innobase_stats_on_metadata;
srv_print_verbose_log = mysqld_embedded ? 0 : 1; srv_print_verbose_log = mysqld_embedded ? 0 : 1;
/* Store the default charset-collation number of this MySQL /* Store the default charset-collation number of this MySQL
...@@ -5563,6 +5566,7 @@ ha_innobase::info( ...@@ -5563,6 +5566,7 @@ ha_innobase::info(
ib_table = prebuilt->table; ib_table = prebuilt->table;
if (flag & HA_STATUS_TIME) { if (flag & HA_STATUS_TIME) {
if (srv_stats_on_metadata) {
/* In sql_show we call with this flag: update then statistics /* In sql_show we call with this flag: update then statistics
so that they are up-to-date */ so that they are up-to-date */
...@@ -5572,6 +5576,7 @@ ha_innobase::info( ...@@ -5572,6 +5576,7 @@ ha_innobase::info(
prebuilt->trx->op_info = (char*) prebuilt->trx->op_info = (char*)
"returning various info to MySQL"; "returning various info to MySQL";
}
my_snprintf(path, sizeof(path), "%s/%s%s", my_snprintf(path, sizeof(path), "%s/%s%s",
mysql_data_home, ib_table->name, reg_ext); mysql_data_home, ib_table->name, reg_ext);
......
...@@ -213,7 +213,8 @@ extern my_bool innobase_log_archive, ...@@ -213,7 +213,8 @@ extern my_bool innobase_log_archive,
innobase_use_native_aio, innobase_use_native_aio,
innobase_file_per_table, innobase_locks_unsafe_for_binlog, innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_rollback_on_timeout, innobase_rollback_on_timeout,
innobase_create_status_file; innobase_create_status_file,
innobase_stats_on_metadata;
extern "C" { extern "C" {
extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_buf_pool_modified_pct;
extern ulong srv_max_purge_lag; extern ulong srv_max_purge_lag;
......
...@@ -124,6 +124,8 @@ extern ulint srv_fast_shutdown; /* If this is 1, do not do a ...@@ -124,6 +124,8 @@ extern ulint srv_fast_shutdown; /* If this is 1, do not do a
transactions). */ transactions). */
extern ibool srv_innodb_status; extern ibool srv_innodb_status;
extern ibool srv_stats_on_metadata;
extern ibool srv_use_doublewrite_buf; extern ibool srv_use_doublewrite_buf;
extern ibool srv_use_checksums; extern ibool srv_use_checksums;
......
...@@ -317,6 +317,8 @@ ulint srv_fast_shutdown = 0; ...@@ -317,6 +317,8 @@ ulint srv_fast_shutdown = 0;
/* Generate a innodb_status.<pid> file */ /* Generate a innodb_status.<pid> file */
ibool srv_innodb_status = FALSE; ibool srv_innodb_status = FALSE;
ibool srv_stats_on_metadata = TRUE;
ibool srv_use_doublewrite_buf = TRUE; ibool srv_use_doublewrite_buf = TRUE;
ibool srv_use_checksums = TRUE; ibool srv_use_checksums = TRUE;
......
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