diff options
author | Dmitry Lenev <Dmitry.Lenev@oracle.com> | 2011-11-15 22:00:14 +0400 |
---|---|---|
committer | Dmitry Lenev <Dmitry.Lenev@oracle.com> | 2011-11-15 22:00:14 +0400 |
commit | 02e1d6e6060dc6a60b502047fab666e17f191145 (patch) | |
tree | bd48c998427e05c0297d267f7265a34760b1a76c /sql/sys_vars.cc | |
parent | e5aa632cc60dfb1c4fd3ca0788fd938a724f9fa9 (diff) | |
download | mariadb-git-02e1d6e6060dc6a60b502047fab666e17f191145.tar.gz |
Fix for bug#12695572 - "IMPROVE MDL PERFORMANCE IN PRE-VISTA
BY CACHING OR REDUCING CREATEEVENT CALLS".
5.5 versions of MySQL server performed worse than 5.1 versions
under single-connection workload in autocommit mode on Windows XP.
Part of this slowdown can be attributed to overhead associated
with constant creation/destruction of MDL_lock objects in the MDL
subsystem. The problem is that creation/destruction of these
objects causes creation and destruction of associated
synchronization primitives, which are expensive on Windows XP.
This patch tries to alleviate this problem by introducing a cache
of unused MDL_object_lock objects. Instead of destroying such
objects we put them into the cache and then reuse with a new
key when creation of a new object is requested.
To limit the size of this cache, a new --metadata-locks-cache-size
start-up parameter was introduced.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index da8e61da52e..7a04015dc93 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1156,6 +1156,12 @@ static Sys_var_ulonglong Sys_max_heap_table_size( VALID_RANGE(16384, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024), BLOCK_SIZE(1024)); +static Sys_var_ulong Sys_metadata_locks_cache_size( + "metadata_locks_cache_size", "Size of unused metadata locks cache", + READ_ONLY GLOBAL_VAR(mdl_locks_cache_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 1024*1024), DEFAULT(MDL_LOCKS_CACHE_SIZE_DEFAULT), + BLOCK_SIZE(1)); + static Sys_var_ulong Sys_pseudo_thread_id( "pseudo_thread_id", "This variable is for internal server use", |