Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3c12c279
Commit
3c12c279
authored
Nov 20, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
5.5 merge
parents
afca52bb
8bc5eabe
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
351 additions
and
14 deletions
+351
-14
mysql-test/suite/sys_vars/r/innodb_stats_modified_counter_basic.result
...ite/sys_vars/r/innodb_stats_modified_counter_basic.result
+56
-0
mysql-test/suite/sys_vars/r/innodb_stats_traditional_basic.result
...st/suite/sys_vars/r/innodb_stats_traditional_basic.result
+92
-0
mysql-test/suite/sys_vars/t/innodb_stats_modified_counter_basic.test
...suite/sys_vars/t/innodb_stats_modified_counter_basic.test
+47
-0
mysql-test/suite/sys_vars/t/innodb_stats_traditional_basic.test
...test/suite/sys_vars/t/innodb_stats_traditional_basic.test
+65
-0
storage/innobase/btr/btr0cur.cc
storage/innobase/btr/btr0cur.cc
+19
-6
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+12
-0
storage/innobase/include/srv0srv.h
storage/innobase/include/srv0srv.h
+2
-0
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+5
-1
storage/innobase/srv/srv0srv.cc
storage/innobase/srv/srv0srv.cc
+8
-0
storage/xtradb/btr/btr0cur.cc
storage/xtradb/btr/btr0cur.cc
+19
-6
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+12
-0
storage/xtradb/include/srv0srv.h
storage/xtradb/include/srv0srv.h
+2
-0
storage/xtradb/row/row0mysql.cc
storage/xtradb/row/row0mysql.cc
+4
-1
storage/xtradb/srv/srv0srv.cc
storage/xtradb/srv/srv0srv.cc
+8
-0
No files found.
mysql-test/suite/sys_vars/r/innodb_stats_modified_counter_basic.result
0 → 100644
View file @
3c12c279
SET @start_global_value = @@global.innodb_stats_modified_counter;
SELECT @start_global_value;
@start_global_value
0
Valid values are one or above
select @@global.innodb_stats_modified_counter >=1;
@@global.innodb_stats_modified_counter >=1
0
select @@global.innodb_stats_modified_counter;
@@global.innodb_stats_modified_counter
0
select @@session.innodb_stats_modified_counter;
ERROR HY000: Variable 'innodb_stats_modified_counter' is a GLOBAL variable
show global variables like 'innodb_stats_modified_counter';
Variable_name Value
innodb_stats_modified_counter 0
show session variables like 'innodb_stats_modified_counter';
Variable_name Value
innodb_stats_modified_counter 0
select * from information_schema.global_variables where variable_name='innodb_stats_modified_counter';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_MODIFIED_COUNTER 0
select * from information_schema.session_variables where variable_name='innodb_stats_modified_counter';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_MODIFIED_COUNTER 0
set global innodb_stats_modified_counter=10;
select @@global.innodb_stats_modified_counter;
@@global.innodb_stats_modified_counter
10
select * from information_schema.global_variables where variable_name='innodb_stats_modified_counter';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_MODIFIED_COUNTER 10
select * from information_schema.session_variables where variable_name='innodb_stats_modified_counter';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_MODIFIED_COUNTER 10
set session innodb_stats_modified_counter=1;
ERROR HY000: Variable 'innodb_stats_modified_counter' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_stats_modified_counter=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_modified_counter'
set global innodb_stats_modified_counter=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_modified_counter'
set global innodb_stats_modified_counter="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_stats_modified_counter'
set global innodb_stats_modified_counter=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_stats_modified_counter value: '-7'
select @@global.innodb_stats_modified_counter;
@@global.innodb_stats_modified_counter
0
select * from information_schema.global_variables where variable_name='innodb_stats_modified_counter';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_MODIFIED_COUNTER 0
SET @@global.innodb_stats_modified_counter = @start_global_value;
SELECT @@global.innodb_stats_modified_counter;
@@global.innodb_stats_modified_counter
0
mysql-test/suite/sys_vars/r/innodb_stats_traditional_basic.result
0 → 100644
View file @
3c12c279
SET @start_global_value = @@global.innodb_stats_traditional;
SELECT @start_global_value;
@start_global_value
0
Valid values are 'ON' and 'OFF'
select @@global.innodb_stats_traditional in (0, 1);
@@global.innodb_stats_traditional in (0, 1)
1
select @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
0
select @@session.innodb_stats_traditional;
ERROR HY000: Variable 'innodb_stats_traditional' is a GLOBAL variable
show global variables like 'innodb_stats_traditional';
Variable_name Value
innodb_stats_traditional OFF
show session variables like 'innodb_stats_traditional';
Variable_name Value
innodb_stats_traditional OFF
select * from information_schema.global_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL OFF
select * from information_schema.session_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL OFF
set global innodb_stats_traditional='OFF';
select @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
0
select * from information_schema.global_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL OFF
select * from information_schema.session_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL OFF
set @@global.innodb_stats_traditional=1;
select @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
1
select * from information_schema.global_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL ON
select * from information_schema.session_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL ON
set global innodb_stats_traditional=0;
select @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
0
select * from information_schema.global_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL OFF
select * from information_schema.session_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL OFF
set @@global.innodb_stats_traditional='ON';
select @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
1
select * from information_schema.global_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL ON
select * from information_schema.session_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL ON
set session innodb_stats_traditional='OFF';
ERROR HY000: Variable 'innodb_stats_traditional' is a GLOBAL variable and should be set with SET GLOBAL
set @@session.innodb_stats_traditional='ON';
ERROR HY000: Variable 'innodb_stats_traditional' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_stats_traditional=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_traditional'
set global innodb_stats_traditional=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_traditional'
set global innodb_stats_traditional=2;
ERROR 42000: Variable 'innodb_stats_traditional' can't be set to the value of '2'
set global innodb_stats_traditional=-3;
ERROR 42000: Variable 'innodb_stats_traditional' can't be set to the value of '-3'
select @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
1
select * from information_schema.global_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL ON
select * from information_schema.session_variables where variable_name='innodb_stats_traditional';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_TRADITIONAL ON
set global innodb_stats_traditional='AUTO';
ERROR 42000: Variable 'innodb_stats_traditional' can't be set to the value of 'AUTO'
SET @@global.innodb_stats_traditional = @start_global_value;
SELECT @@global.innodb_stats_traditional;
@@global.innodb_stats_traditional
0
mysql-test/suite/sys_vars/t/innodb_stats_modified_counter_basic.test
0 → 100644
View file @
3c12c279
--
source
include
/
have_innodb
.
inc
SET
@
start_global_value
=
@@
global
.
innodb_stats_modified_counter
;
SELECT
@
start_global_value
;
#
# exists as global only
#
--
echo
Valid
values
are
one
or
above
select
@@
global
.
innodb_stats_modified_counter
>=
1
;
select
@@
global
.
innodb_stats_modified_counter
;
--
error
ER_INCORRECT_GLOBAL_LOCAL_VAR
select
@@
session
.
innodb_stats_modified_counter
;
show
global
variables
like
'innodb_stats_modified_counter'
;
show
session
variables
like
'innodb_stats_modified_counter'
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_modified_counter'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_modified_counter'
;
#
# show that it's writable
#
set
global
innodb_stats_modified_counter
=
10
;
select
@@
global
.
innodb_stats_modified_counter
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_modified_counter'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_modified_counter'
;
--
error
ER_GLOBAL_VARIABLE
set
session
innodb_stats_modified_counter
=
1
;
#
# incorrect types
#
--
error
ER_WRONG_TYPE_FOR_VAR
set
global
innodb_stats_modified_counter
=
1.1
;
--
error
ER_WRONG_TYPE_FOR_VAR
set
global
innodb_stats_modified_counter
=
1
e1
;
--
error
ER_WRONG_TYPE_FOR_VAR
set
global
innodb_stats_modified_counter
=
"foo"
;
set
global
innodb_stats_modified_counter
=-
7
;
select
@@
global
.
innodb_stats_modified_counter
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_modified_counter'
;
#
# cleanup
#
SET
@@
global
.
innodb_stats_modified_counter
=
@
start_global_value
;
SELECT
@@
global
.
innodb_stats_modified_counter
;
mysql-test/suite/sys_vars/t/innodb_stats_traditional_basic.test
0 → 100644
View file @
3c12c279
--
source
include
/
have_innodb
.
inc
SET
@
start_global_value
=
@@
global
.
innodb_stats_traditional
;
SELECT
@
start_global_value
;
#
# exists as global only
#
--
echo
Valid
values
are
'ON'
and
'OFF'
select
@@
global
.
innodb_stats_traditional
in
(
0
,
1
);
select
@@
global
.
innodb_stats_traditional
;
--
error
ER_INCORRECT_GLOBAL_LOCAL_VAR
select
@@
session
.
innodb_stats_traditional
;
show
global
variables
like
'innodb_stats_traditional'
;
show
session
variables
like
'innodb_stats_traditional'
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_traditional'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_traditional'
;
#
# show that it's writable
#
set
global
innodb_stats_traditional
=
'OFF'
;
select
@@
global
.
innodb_stats_traditional
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_traditional'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_traditional'
;
set
@@
global
.
innodb_stats_traditional
=
1
;
select
@@
global
.
innodb_stats_traditional
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_traditional'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_traditional'
;
set
global
innodb_stats_traditional
=
0
;
select
@@
global
.
innodb_stats_traditional
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_traditional'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_traditional'
;
set
@@
global
.
innodb_stats_traditional
=
'ON'
;
select
@@
global
.
innodb_stats_traditional
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_traditional'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_traditional'
;
--
error
ER_GLOBAL_VARIABLE
set
session
innodb_stats_traditional
=
'OFF'
;
--
error
ER_GLOBAL_VARIABLE
set
@@
session
.
innodb_stats_traditional
=
'ON'
;
#
# incorrect types
#
--
error
ER_WRONG_TYPE_FOR_VAR
set
global
innodb_stats_traditional
=
1.1
;
--
error
ER_WRONG_TYPE_FOR_VAR
set
global
innodb_stats_traditional
=
1
e1
;
--
error
ER_WRONG_VALUE_FOR_VAR
set
global
innodb_stats_traditional
=
2
;
--
error
ER_WRONG_VALUE_FOR_VAR
set
global
innodb_stats_traditional
=-
3
;
select
@@
global
.
innodb_stats_traditional
;
select
*
from
information_schema
.
global_variables
where
variable_name
=
'innodb_stats_traditional'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'innodb_stats_traditional'
;
--
error
ER_WRONG_VALUE_FOR_VAR
set
global
innodb_stats_traditional
=
'AUTO'
;
#
# Cleanup
#
SET
@@
global
.
innodb_stats_traditional
=
@
start_global_value
;
SELECT
@@
global
.
innodb_stats_traditional
;
storage/innobase/btr/btr0cur.cc
View file @
3c12c279
...
...
@@ -3870,16 +3870,29 @@ btr_estimate_number_of_different_key_vals(
ut_error
;
}
/* It makes no sense to test more pages than are contained
in the index, thus we lower the number if it is too high */
if
(
srv_stats_transient_sample_pages
>
index
->
stat_index_size
)
{
if
(
srv_stats_sample_traditional
)
{
/* It makes no sense to test more pages than are contained
in the index, thus we lower the number if it is too high */
if
(
srv_stats_transient_sample_pages
>
index
->
stat_index_size
)
{
if
(
index
->
stat_index_size
>
0
)
{
n_sample_pages
=
index
->
stat_index_size
;
}
else
{
n_sample_pages
=
1
;
}
}
else
{
n_sample_pages
=
srv_stats_transient_sample_pages
;
}
}
else
{
/* New logaritmic number of pages that are estimated. We
first pick minimun from srv_stats_transient_sample_pages and number of
pages on index. Then we pick maximum from previous number of
pages and log2(number of index pages) * srv_stats_transient_sample_pages. */
if
(
index
->
stat_index_size
>
0
)
{
n_sample_pages
=
index
->
stat_index_size
;
n_sample_pages
=
ut_max
(
ut_min
(
srv_stats_transient_sample_pages
,
index
->
stat_index_size
),
log2
(
index
->
stat_index_size
)
*
srv_stats_transient_sample_pages
);
}
else
{
n_sample_pages
=
1
;
}
}
else
{
n_sample_pages
=
srv_stats_transient_sample_pages
;
}
/* We sample some pages in the index to get an estimate */
...
...
storage/innobase/handler/ha_innodb.cc
View file @
3c12c279
...
...
@@ -16364,6 +16364,16 @@ static MYSQL_SYSVAR_ULONGLONG(stats_persistent_sample_pages,
"statistics (by ANALYZE, default 20)"
,
NULL
,
NULL
,
20
,
1
,
~
0ULL
,
0
);
static
MYSQL_SYSVAR_ULONGLONG
(
stats_modified_counter
,
srv_stats_modified_counter
,
PLUGIN_VAR_RQCMDARG
,
"The number of rows modified before we calculate new statistics (default 0 = current limits)"
,
NULL
,
NULL
,
0
,
0
,
~
0ULL
,
0
);
static
MYSQL_SYSVAR_BOOL
(
stats_traditional
,
srv_stats_sample_traditional
,
PLUGIN_VAR_RQCMDARG
,
"Enable traditional statistic calculation based on number of configured pages (default false)"
,
NULL
,
NULL
,
FALSE
);
static
MYSQL_SYSVAR_BOOL
(
adaptive_hash_index
,
btr_search_enabled
,
PLUGIN_VAR_OPCMDARG
,
"Enable InnoDB adaptive hash index (enabled by default). "
...
...
@@ -16989,6 +16999,8 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR
(
stats_persistent
),
MYSQL_SYSVAR
(
stats_persistent_sample_pages
),
MYSQL_SYSVAR
(
stats_auto_recalc
),
MYSQL_SYSVAR
(
stats_modified_counter
),
MYSQL_SYSVAR
(
stats_traditional
),
MYSQL_SYSVAR
(
adaptive_hash_index
),
MYSQL_SYSVAR
(
stats_method
),
MYSQL_SYSVAR
(
replication_delay
),
...
...
storage/innobase/include/srv0srv.h
View file @
3c12c279
...
...
@@ -356,6 +356,8 @@ extern unsigned long long srv_stats_transient_sample_pages;
extern
my_bool
srv_stats_persistent
;
extern
unsigned
long
long
srv_stats_persistent_sample_pages
;
extern
my_bool
srv_stats_auto_recalc
;
extern
unsigned
long
long
srv_stats_modified_counter
;
extern
my_bool
srv_stats_sample_traditional
;
extern
ibool
srv_use_doublewrite_buf
;
extern
ulong
srv_doublewrite_batch_size
;
...
...
storage/innobase/row/row0mysql.cc
View file @
3c12c279
...
...
@@ -1055,8 +1055,12 @@ row_update_statistics_if_needed(
since the last time a statistics batch was run.
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often. */
ib_uint64_t
threshold
=
16
+
n_rows
/
16
;
/* 6.25% */
if
(
srv_stats_modified_counter
)
threshold
=
ut_min
(
srv_stats_modified_counter
,
threshold
);
if
(
counter
>
16
+
n_rows
/
16
/* 6.25% */
)
{
if
(
counter
>
threshold
)
{
ib_uint64_t
threshold
=
16
+
n_rows
/
16
;
/* 6.25% */
ut_ad
(
!
mutex_own
(
&
dict_sys
->
mutex
));
/* this will reset table->stat_modified_counter to 0 */
...
...
storage/innobase/srv/srv0srv.cc
View file @
3c12c279
...
...
@@ -340,6 +340,14 @@ UNIV_INTERN my_bool srv_stats_persistent = TRUE;
UNIV_INTERN
unsigned
long
long
srv_stats_persistent_sample_pages
=
20
;
UNIV_INTERN
my_bool
srv_stats_auto_recalc
=
TRUE
;
/* The number of rows modified before we calculate new statistics (default 0
= current limits) */
UNIV_INTERN
unsigned
long
long
srv_stats_modified_counter
=
0
;
/* Enable traditional statistic calculation based on number of configured
pages default false. */
UNIV_INTERN
my_bool
srv_stats_sample_traditional
=
FALSE
;
UNIV_INTERN
ibool
srv_use_doublewrite_buf
=
TRUE
;
/** doublewrite buffer is 1MB is size i.e.: it can hold 128 16K pages.
...
...
storage/xtradb/btr/btr0cur.cc
View file @
3c12c279
...
...
@@ -4061,16 +4061,29 @@ btr_estimate_number_of_different_key_vals(
ut_error
;
}
/* It makes no sense to test more pages than are contained
in the index, thus we lower the number if it is too high */
if
(
srv_stats_transient_sample_pages
>
index
->
stat_index_size
)
{
if
(
srv_stats_sample_traditional
)
{
/* It makes no sense to test more pages than are contained
in the index, thus we lower the number if it is too high */
if
(
srv_stats_transient_sample_pages
>
index
->
stat_index_size
)
{
if
(
index
->
stat_index_size
>
0
)
{
n_sample_pages
=
index
->
stat_index_size
;
}
else
{
n_sample_pages
=
1
;
}
}
else
{
n_sample_pages
=
srv_stats_transient_sample_pages
;
}
}
else
{
/* New logaritmic number of pages that are estimated. We
first pick minimun from srv_stats_transient_sample_pages and number of
pages on index. Then we pick maximum from previous number of
pages and log2(number of index pages) * srv_stats_transient_sample_pages. */
if
(
index
->
stat_index_size
>
0
)
{
n_sample_pages
=
index
->
stat_index_size
;
n_sample_pages
=
ut_max
(
ut_min
(
srv_stats_transient_sample_pages
,
index
->
stat_index_size
),
log2
(
index
->
stat_index_size
)
*
srv_stats_transient_sample_pages
);
}
else
{
n_sample_pages
=
1
;
}
}
else
{
n_sample_pages
=
srv_stats_transient_sample_pages
;
}
/* We sample some pages in the index to get an estimate */
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
3c12c279
...
...
@@ -17462,6 +17462,16 @@ static MYSQL_SYSVAR_ULONGLONG(stats_persistent_sample_pages,
"statistics (by ANALYZE, default 20)"
,
NULL
,
NULL
,
20
,
1
,
~
0ULL
,
0
);
static
MYSQL_SYSVAR_ULONGLONG
(
stats_modified_counter
,
srv_stats_modified_counter
,
PLUGIN_VAR_RQCMDARG
,
"The number of rows modified before we calculate new statistics (default 0 = current limits)"
,
NULL
,
NULL
,
0
,
0
,
~
0ULL
,
0
);
static
MYSQL_SYSVAR_BOOL
(
stats_traditional
,
srv_stats_sample_traditional
,
PLUGIN_VAR_RQCMDARG
,
"Enable traditional statistic calculation based on number of configured pages (default false)"
,
NULL
,
NULL
,
FALSE
);
static
MYSQL_SYSVAR_BOOL
(
adaptive_hash_index
,
btr_search_enabled
,
PLUGIN_VAR_OPCMDARG
,
"Enable InnoDB adaptive hash index (enabled by default). "
...
...
@@ -18284,6 +18294,8 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR
(
stats_persistent
),
MYSQL_SYSVAR
(
stats_persistent_sample_pages
),
MYSQL_SYSVAR
(
stats_auto_recalc
),
MYSQL_SYSVAR
(
stats_modified_counter
),
MYSQL_SYSVAR
(
stats_traditional
),
MYSQL_SYSVAR
(
adaptive_hash_index
),
MYSQL_SYSVAR
(
adaptive_hash_index_partitions
),
MYSQL_SYSVAR
(
stats_method
),
...
...
storage/xtradb/include/srv0srv.h
View file @
3c12c279
...
...
@@ -427,6 +427,8 @@ extern unsigned long long srv_stats_transient_sample_pages;
extern
my_bool
srv_stats_persistent
;
extern
unsigned
long
long
srv_stats_persistent_sample_pages
;
extern
my_bool
srv_stats_auto_recalc
;
extern
unsigned
long
long
srv_stats_modified_counter
;
extern
my_bool
srv_stats_sample_traditional
;
extern
ibool
srv_use_doublewrite_buf
;
extern
ulong
srv_doublewrite_batch_size
;
...
...
storage/xtradb/row/row0mysql.cc
View file @
3c12c279
...
...
@@ -1054,8 +1054,11 @@ row_update_statistics_if_needed(
since the last time a statistics batch was run.
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often. */
ib_uint64_t
threshold
=
16
+
n_rows
/
16
;
/* 6.25% */
if
(
srv_stats_modified_counter
)
threshold
=
ut_min
(
srv_stats_modified_counter
,
threshold
);
if
(
counter
>
16
+
n_rows
/
16
/* 6.25% */
)
{
if
(
counter
>
threshold
)
{
ut_ad
(
!
mutex_own
(
&
dict_sys
->
mutex
));
/* this will reset table->stat_modified_counter to 0 */
...
...
storage/xtradb/srv/srv0srv.cc
View file @
3c12c279
...
...
@@ -457,6 +457,14 @@ UNIV_INTERN my_bool srv_stats_persistent = TRUE;
UNIV_INTERN
unsigned
long
long
srv_stats_persistent_sample_pages
=
20
;
UNIV_INTERN
my_bool
srv_stats_auto_recalc
=
TRUE
;
/* The number of rows modified before we calculate new statistics (default 0
= current limits) */
UNIV_INTERN
unsigned
long
long
srv_stats_modified_counter
=
0
;
/* Enable traditional statistic calculation based on number of configured
pages default false. */
UNIV_INTERN
my_bool
srv_stats_sample_traditional
=
FALSE
;
UNIV_INTERN
ibool
srv_use_doublewrite_buf
=
TRUE
;
UNIV_INTERN
ibool
srv_use_atomic_writes
=
FALSE
;
#ifdef HAVE_POSIX_FALLOCATE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment