summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2013-08-14 12:48:50 +0400
committerSergey Vojtovich <svoj@mariadb.org>2013-08-14 12:48:50 +0400
commitb7f9c894236c38cb40b5ca70e36d23497fcc01be (patch)
tree26b3f7e1e848893059f66e7e6bc7cc5a8c56c036 /sql/sys_vars.cc
parentb882a3e83eba1be324f4f898ae24e78244e2378d (diff)
downloadmariadb-git-b7f9c894236c38cb40b5ca70e36d23497fcc01be.tar.gz
MDEV-4702 - Reduce usage of LOCK_open
Following variables do not require LOCK_open protection anymore: - table_def_cache (renamed to tdc_hash) is protected by rw-lock LOCK_tdc_hash; - table_def_shutdown_in_progress doesn't need LOCK_open protection; - last_table_id use atomics; - TABLE_SHARE::ref_count (renamed to TABLE_SHARE::tdc.ref_count) is protected by TABLE_SHARE::tdc.LOCK_table_share; - TABLE_SHARE::next, ::prev (renamed to tdc.next and tdc.prev), oldest_unused_share, end_of_unused_share are protected by LOCK_unused_shares; - TABLE_SHARE::m_flush_tickets (renamed to tdc.m_flush_tickets) is protected by TABLE_SHARE::tdc.LOCK_table_share; - refresh_version (renamed to tdc_version) use atomics.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index bb96d69ebc5..f3c90cdb643 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2675,16 +2675,25 @@ static Sys_var_charptr Sys_system_time_zone(
static Sys_var_ulong Sys_table_def_size(
"table_definition_cache",
"The number of cached table definitions",
- GLOBAL_VAR(table_def_size), CMD_LINE(REQUIRED_ARG),
+ GLOBAL_VAR(tdc_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(TABLE_DEF_CACHE_MIN, 512*1024),
DEFAULT(TABLE_DEF_CACHE_DEFAULT), BLOCK_SIZE(1));
static Sys_var_ulong Sys_table_cache_size(
"table_open_cache", "The number of cached open tables",
- GLOBAL_VAR(table_cache_size), CMD_LINE(REQUIRED_ARG),
+ GLOBAL_VAR(tc_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1, 512*1024), DEFAULT(TABLE_OPEN_CACHE_DEFAULT),
BLOCK_SIZE(1));
+static ulong table_cache_instances;
+static Sys_var_ulong Sys_table_cache_instances(
+ "table_open_cache_instances",
+ "MySQL 5.6 compatible option. Not used or needed in MariaDB",
+ READ_ONLY GLOBAL_VAR(table_cache_instances), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 64), DEFAULT(1),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL),
+ ON_UPDATE(NULL), NULL);
+
static Sys_var_ulong Sys_thread_cache_size(
"thread_cache_size",
"How many threads we should keep in a cache for reuse",