diff options
author | Monty <monty@mariadb.org> | 2014-08-29 14:09:51 +0300 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2014-12-05 11:01:50 +0400 |
commit | 070a6e7a890e5a73eb38920657c060605e520b55 (patch) | |
tree | 33268dd48283f0ae232c0b378ed42c83c18398ab | |
parent | 9127784d5ce845c9d66a34eee371cbaf82468d89 (diff) | |
download | mariadb-git-070a6e7a890e5a73eb38920657c060605e520b55.tar.gz |
- Changed default values of query_prealloc_size and query_alloc_block_size
so that a simple query with one join would not have to call my_malloc.
- Allow lower limites for query_prealloc_size for testing.
- Fixed wrong initialization of trans_alloc_block_size
-rw-r--r-- | mysql-test/r/mysqld--help.result | 4 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result | 20 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result | 46 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test | 4 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test | 4 | ||||
-rw-r--r-- | sql/sql_const.h | 6 | ||||
-rw-r--r-- | sql/sys_vars.cc | 4 |
8 files changed, 50 insertions, 50 deletions
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index e8ceaac0a1f..e37d86d9567 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -1298,14 +1298,14 @@ preload-buffer-size 32768 profiling-history-size 15 progress-report-time 5 protocol-version 10 -query-alloc-block-size 8192 +query-alloc-block-size 16384 query-cache-limit 1048576 query-cache-min-res-unit 4096 query-cache-size 0 query-cache-strip-comments FALSE query-cache-type ON query-cache-wlock-invalidate FALSE -query-prealloc-size 8192 +query-prealloc-size 24576 range-alloc-block-size 4096 read-buffer-size 131072 read-only FALSE diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 28b6be90ece..ddb007439d1 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -317,8 +317,8 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', 'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value -query_alloc_block_size 8192 -query_prealloc_size 8192 +query_alloc_block_size 16384 +query_prealloc_size 24576 range_alloc_block_size 4096 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 @@ -328,8 +328,8 @@ WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1; VARIABLE_NAME VARIABLE_VALUE -QUERY_ALLOC_BLOCK_SIZE 8192 -QUERY_PREALLOC_SIZE 8192 +QUERY_ALLOC_BLOCK_SIZE 16384 +QUERY_PREALLOC_SIZE 24576 RANGE_ALLOC_BLOCK_SIZE 4096 TRANSACTION_ALLOC_BLOCK_SIZE 8192 TRANSACTION_PREALLOC_SIZE 4096 @@ -410,8 +410,8 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', 'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value -query_alloc_block_size 8192 -query_prealloc_size 8192 +query_alloc_block_size 16384 +query_prealloc_size 24576 range_alloc_block_size 4096 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result index eb6851baa93..0d7abae094b 100644 --- a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result +++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result @@ -1,11 +1,11 @@ SET @start_global_value = @@global.query_alloc_block_size; SELECT @start_global_value; @start_global_value -8192 +16384 SET @start_session_value = @@session.query_alloc_block_size; SELECT @start_session_value; @start_session_value -8192 +16384 '#--------------------FN_DYNVARS_130_01-------------------------#' SET @@global.query_alloc_block_size = 10000; Warnings: @@ -13,22 +13,22 @@ Warning 1292 Truncated incorrect query_alloc_block_size value: '10000' SET @@global.query_alloc_block_size = DEFAULT; SELECT @@global.query_alloc_block_size; @@global.query_alloc_block_size -8192 +16384 SET @@session.query_alloc_block_size = 20000; Warnings: Warning 1292 Truncated incorrect query_alloc_block_size value: '20000' SET @@session.query_alloc_block_size = DEFAULT; SELECT @@session.query_alloc_block_size; @@session.query_alloc_block_size -8192 +16384 '#--------------------FN_DYNVARS_130_02-------------------------#' SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size = 8192; -@@global.query_alloc_block_size = 8192 +SELECT @@global.query_alloc_block_size = 16384; +@@global.query_alloc_block_size = 16384 1 SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size = 8192; -@@session.query_alloc_block_size = 8192 +SELECT @@session.query_alloc_block_size = 16384; +@@session.query_alloc_block_size = 16384 1 '#--------------------FN_DYNVARS_130_03-------------------------#' SET @@global.query_alloc_block_size = 1024; @@ -177,8 +177,8 @@ ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list' SET @@global.query_alloc_block_size = @start_global_value; SELECT @@global.query_alloc_block_size; @@global.query_alloc_block_size -8192 +16384 SET @@session.query_alloc_block_size = @start_session_value; SELECT @@session.query_alloc_block_size; @@session.query_alloc_block_size -8192 +16384 diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result index 1fd363ade16..9095dd56ea9 100644 --- a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result +++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result @@ -1,11 +1,11 @@ SET @start_global_value = @@global.query_prealloc_size ; SELECT @start_global_value; @start_global_value -8192 +24576 SET @start_session_value = @@session.query_prealloc_size ; SELECT @start_session_value; @start_session_value -8192 +24576 '#--------------------FN_DYNVARS_005_01-------------------------#' SET @@global.query_prealloc_size = 100; Warnings: @@ -13,22 +13,22 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '100' SET @@global.query_prealloc_size = DEFAULT; SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +24576 SET @@session.query_prealloc_size = 200; Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '200' SET @@session.query_prealloc_size = DEFAULT; SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size -8192 +24576 '#--------------------FN_DYNVARS_005_02-------------------------#' SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size = 8192; -@@global.query_prealloc_size = 8192 +SELECT @@global.query_prealloc_size = 24576; +@@global.query_prealloc_size = 24576 1 SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size = 8192; -@@session.query_prealloc_size = 8192 +SELECT @@session.query_prealloc_size = 24576; +@@session.query_prealloc_size = 24576 1 '#--------------------FN_DYNVARS_005_03-------------------------#' SET @@global.query_prealloc_size = 8192; @@ -58,53 +58,53 @@ Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '0' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@global.query_prealloc_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@global.query_prealloc_size = test; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@global.query_prealloc_size = "test"; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@global.query_prealloc_size = 'test'; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@global.query_prealloc_size = ON; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@session.query_prealloc_size = 0; Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '0' SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size -8192 +1024 SET @@session.query_prealloc_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size -8192 +1024 SET @@session.query_prealloc_size = test; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size -8192 +1024 SET @@session.query_prealloc_size = "test"; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size -8192 +1024 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.query_prealloc_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -123,13 +123,13 @@ Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '1' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 SET @@global.query_prealloc_size = FALSE; Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '0' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +1024 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.query_prealloc_size = 10; Warnings: @@ -153,7 +153,7 @@ Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '1' SELECT @@query_prealloc_size ; @@query_prealloc_size -8192 +1024 SELECT local.query_prealloc_size ; ERROR 42S02: Unknown table 'local' in field list SELECT session.query_prealloc_size ; @@ -163,8 +163,8 @@ ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list' SET @@global.query_prealloc_size = @start_global_value; SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -8192 +24576 SET @@session.query_prealloc_size = @start_session_value; SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size -8192 +24576 diff --git a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test index 9def567b994..1793652397f 100644 --- a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test +++ b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test @@ -60,10 +60,10 @@ SELECT @@session.query_alloc_block_size; ################################################################### SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size = 8192; +SELECT @@global.query_alloc_block_size = 16384; SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size = 8192; +SELECT @@session.query_alloc_block_size = 16384; --echo '#--------------------FN_DYNVARS_130_03-------------------------#' diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test index 3914bff4ca9..1a6ed56c5f9 100644 --- a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test +++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test @@ -60,10 +60,10 @@ SELECT @@session.query_prealloc_size ; ######################################################################## SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size = 8192; +SELECT @@global.query_prealloc_size = 24576; SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size = 8192; +SELECT @@session.query_prealloc_size = 24576; --echo '#--------------------FN_DYNVARS_005_03-------------------------#' diff --git a/sql/sql_const.h b/sql/sql_const.h index 2cbc616559d..18a74d8579e 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -148,9 +148,9 @@ #define MYSQLD_NET_RETRY_COUNT 10 ///< Abort read after this many int. #endif -#define QUERY_ALLOC_BLOCK_SIZE 8192 -#define QUERY_ALLOC_PREALLOC_SIZE 8192 -#define TRANS_ALLOC_BLOCK_SIZE 4096 +#define QUERY_ALLOC_BLOCK_SIZE 16384 +#define QUERY_ALLOC_PREALLOC_SIZE 24576 +#define TRANS_ALLOC_BLOCK_SIZE 8192 #define TRANS_ALLOC_PREALLOC_SIZE 4096 #define RANGE_ALLOC_BLOCK_SIZE 4096 #define ACL_ALLOC_BLOCK_SIZE 1024 diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 145948e381d..3f648beb07a 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2442,7 +2442,7 @@ static Sys_var_ulong Sys_query_prealloc_size( "query_prealloc_size", "Persistent buffer for query parsing and execution", SESSION_VAR(query_prealloc_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(QUERY_ALLOC_PREALLOC_SIZE, UINT_MAX), + VALID_RANGE(1024, UINT_MAX), DEFAULT(QUERY_ALLOC_PREALLOC_SIZE), BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_thd_mem_root)); @@ -2533,7 +2533,7 @@ static Sys_var_ulong Sys_trans_alloc_block_size( "transaction_alloc_block_size", "Allocation block size for transactions to be stored in binary log", SESSION_VAR(trans_alloc_block_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1024, UINT_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE), + VALID_RANGE(1024, UINT_MAX), DEFAULT(TRANS_ALLOC_BLOCK_SIZE), BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_trans_mem_root)); |