summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-12-05 00:31:05 -0800
committerIgor Babaev <igor@askmonty.org>2012-12-05 00:31:05 -0800
commitb110132516158382e72a75a3c7b26dc538c2f23d (patch)
tree2eb709d57dbae8f8a909008b1546cb395728d8fe /mysql-test/r
parentf8bfb65b132dae3472d3f4f88995e4cad7f72ebf (diff)
downloadmariadb-git-b110132516158382e72a75a3c7b26dc538c2f23d.tar.gz
Changed the names of the system tables for statistical data:
table_stat -> table_stats column_stat -> column_stats index_stat -> index_stats to be in line with the names of innodb statistical tables from mysql-5.6: innodb_table_stats and innodb_index_stats.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/1st.result6
-rw-r--r--mysql-test/r/connect.result18
-rw-r--r--mysql-test/r/information_schema.result12
-rw-r--r--mysql-test/r/log_tables_upgrade.result6
-rw-r--r--mysql-test/r/mysql_upgrade.result42
-rw-r--r--mysql-test/r/mysql_upgrade_ssl.result6
-rw-r--r--mysql-test/r/mysqlcheck.result24
-rw-r--r--mysql-test/r/stat_tables.result22
-rw-r--r--mysql-test/r/stat_tables_innodb.result22
-rw-r--r--mysql-test/r/stat_tables_par.result18
-rw-r--r--mysql-test/r/stat_tables_par_innodb.result18
-rw-r--r--mysql-test/r/statistics.result228
-rw-r--r--mysql-test/r/system_mysql_db.result18
-rw-r--r--mysql-test/r/system_mysql_db_fix40123.result18
-rw-r--r--mysql-test/r/system_mysql_db_fix50030.result18
-rw-r--r--mysql-test/r/system_mysql_db_fix50117.result18
16 files changed, 247 insertions, 247 deletions
diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result
index 9c97cd3d2c3..a948031ea2e 100644
--- a/mysql-test/r/1st.result
+++ b/mysql-test/r/1st.result
@@ -7,7 +7,7 @@ performance_schema
test
show tables in mysql;
Tables_in_mysql
-column_stat
+column_stats
columns_priv
db
event
@@ -18,7 +18,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -26,7 +26,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 7d54ad8b06b..a4bd6a262a7 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -1,7 +1,7 @@
drop table if exists t1,t2;
show tables;
Tables_in_mysql
-column_stat
+column_stats
columns_priv
db
event
@@ -12,7 +12,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -20,7 +20,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -38,7 +38,7 @@ grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
show tables;
Tables_in_mysql
-column_stat
+column_stats
columns_priv
db
event
@@ -49,7 +49,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -57,7 +57,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -83,7 +83,7 @@ ERROR HY000: Password hash should be a 41-digit hexadecimal number
set password=old_password('gambling3');
show tables;
Tables_in_mysql
-column_stat
+column_stats
columns_priv
db
event
@@ -94,7 +94,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -102,7 +102,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 6bf4cdaeeba..790198ddb44 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -81,7 +81,7 @@ TRIGGERS
USER_PRIVILEGES
USER_STATISTICS
VIEWS
-column_stat
+column_stats
columns_priv
db
event
@@ -92,7 +92,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
plugin
proc
procs_priv
@@ -104,7 +104,7 @@ t2
t3
t4
t5
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -123,7 +123,7 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
-table_stat table_stat
+table_stats table_stats
tables_priv tables_priv
time_zone time_zone
time_zone_leap_second time_zone_leap_second
@@ -145,7 +145,7 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
-table_stat table_stat
+table_stats table_stats
tables_priv tables_priv
time_zone time_zone
time_zone_leap_second time_zone_leap_second
@@ -167,7 +167,7 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
-table_stat table_stat
+table_stats table_stats
tables_priv tables_priv
time_zone time_zone
time_zone_leap_second time_zone_leap_second
diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result
index 09dd996aa54..66194267380 100644
--- a/mysql-test/r/log_tables_upgrade.result
+++ b/mysql-test/r/log_tables_upgrade.result
@@ -19,7 +19,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -29,7 +29,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
@@ -37,7 +37,7 @@ mysql.procs_priv OK
mysql.proxies_priv OK
mysql.renamed_general_log OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index e1d1153a47a..1bd2944f86e 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -7,7 +7,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -17,14 +17,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -47,7 +47,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -57,14 +57,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -87,7 +87,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -97,14 +97,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -130,7 +130,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -140,14 +140,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -176,7 +176,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -186,14 +186,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -225,7 +225,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -235,14 +235,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -277,7 +277,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -287,14 +287,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result
index 40a20e38a1d..29a33a7e8ac 100644
--- a/mysql-test/r/mysql_upgrade_ssl.result
+++ b/mysql-test/r/mysql_upgrade_ssl.result
@@ -9,7 +9,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -19,14 +19,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 288dc5bd213..034913a72e6 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -3,7 +3,7 @@ drop view if exists v1;
drop database if exists client_test_db;
mtr.global_suppressions OK
mtr.test_suppressions OK
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -13,14 +13,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -30,7 +30,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
mtr.global_suppressions Table is already up to date
mtr.test_suppressions Table is already up to date
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -40,14 +40,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -55,7 +55,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-mysql.column_stat OK
+mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -65,14 +65,14 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
-mysql.index_stat OK
+mysql.index_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
-mysql.table_stat OK
+mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -80,7 +80,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-mysql.column_stat Table is already up to date
+mysql.column_stats Table is already up to date
mysql.columns_priv Table is already up to date
mysql.db Table is already up to date
mysql.event Table is already up to date
@@ -90,14 +90,14 @@ mysql.help_keyword Table is already up to date
mysql.help_relation Table is already up to date
mysql.help_topic Table is already up to date
mysql.host Table is already up to date
-mysql.index_stat Table is already up to date
+mysql.index_stats Table is already up to date
mysql.ndb_binlog_index Table is already up to date
mysql.plugin Table is already up to date
mysql.proc Table is already up to date
mysql.procs_priv Table is already up to date
mysql.proxies_priv Table is already up to date
mysql.servers Table is already up to date
-mysql.table_stat Table is already up to date
+mysql.table_stats Table is already up to date
mysql.tables_priv Table is already up to date
mysql.time_zone Table is already up to date
mysql.time_zone_leap_second Table is already up to date
diff --git a/mysql-test/r/stat_tables.result b/mysql-test/r/stat_tables.result
index 169266fea25..6905725a6a2 100644
--- a/mysql-test/r/stat_tables.result
+++ b/mysql-test/r/stat_tables.result
@@ -11,7 +11,7 @@ CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
-select * from mysql.table_stat;
+select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
@@ -21,7 +21,7 @@ dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
-select * from mysql.index_stat;
+select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
@@ -83,8 +83,8 @@ n_name revenue
PERU 321915.8715
ARGENTINA 69817.1451
set optimizer_switch=@save_optimizer_switch;
-delete from mysql.index_stat;
-select * from mysql.table_stat;
+delete from mysql.index_stats;
+select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
@@ -94,7 +94,7 @@ dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
-select * from mysql.index_stat;
+select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
@@ -124,24 +124,24 @@ dbt3_s001 partsupp i_ps_suppkey 1 70.0000
dbt3_s001 region PRIMARY 1 1.0000
dbt3_s001 supplier PRIMARY 1 1.0000
dbt3_s001 supplier i_s_nationkey 1 1.1111
-select * from mysql.table_stat where table_name='orders';
+select * from mysql.table_stats where table_name='orders';
db_name table_name cardinality
dbt3_s001 orders 1500
-select * from mysql.index_stat where table_name='orders';
+select * from mysql.index_stats where table_name='orders';
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 orders PRIMARY 1 1.0000
dbt3_s001 orders i_o_orderdate 1 1.3321
dbt3_s001 orders i_o_custkey 1 15.0000
-select (select cardinality from mysql.table_stat where table_name='orders') /
-(select avg_frequency from mysql.index_stat
+select (select cardinality from mysql.table_stats where table_name='orders') /
+(select avg_frequency from mysql.index_stats
where index_name='i_o_orderdate' and prefix_arity=1) as n_distinct;
n_distinct
1126.0416
select count(distinct o_orderdate) from orders;
count(distinct o_orderdate)
1126
-select (select cardinality from mysql.table_stat where table_name='orders') /
-(select avg_frequency from mysql.index_stat
+select (select cardinality from mysql.table_stats where table_name='orders') /
+(select avg_frequency from mysql.index_stats
where index_name='i_o_custkey' and prefix_arity=1) as n_distinct;
n_distinct
100.0000
diff --git a/mysql-test/r/stat_tables_innodb.result b/mysql-test/r/stat_tables_innodb.result
index 699df08225e..51e1567309b 100644
--- a/mysql-test/r/stat_tables_innodb.result
+++ b/mysql-test/r/stat_tables_innodb.result
@@ -14,7 +14,7 @@ CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
-select * from mysql.table_stat;
+select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
@@ -24,7 +24,7 @@ dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
-select * from mysql.index_stat;
+select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
@@ -86,8 +86,8 @@ n_name revenue
PERU 321915.8715
ARGENTINA 69817.1451
set optimizer_switch=@save_optimizer_switch;
-delete from mysql.index_stat;
-select * from mysql.table_stat;
+delete from mysql.index_stats;
+select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
@@ -97,7 +97,7 @@ dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
-select * from mysql.index_stat;
+select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
@@ -149,26 +149,26 @@ dbt3_s001 region PRIMARY 1 1.0000
dbt3_s001 supplier PRIMARY 1 1.0000
dbt3_s001 supplier i_s_nationkey 1 1.1111
dbt3_s001 supplier i_s_nationkey 2 1.0000
-select * from mysql.table_stat where table_name='orders';
+select * from mysql.table_stats where table_name='orders';
db_name table_name cardinality
dbt3_s001 orders 1500
-select * from mysql.index_stat where table_name='orders';
+select * from mysql.index_stats where table_name='orders';
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 orders PRIMARY 1 1.0000
dbt3_s001 orders i_o_orderdate 1 1.3321
dbt3_s001 orders i_o_orderdate 2 1.0000
dbt3_s001 orders i_o_custkey 1 15.0000
dbt3_s001 orders i_o_custkey 2 1.0000
-select (select cardinality from mysql.table_stat where table_name='orders') /
-(select avg_frequency from mysql.index_stat
+select (select cardinality from mysql.table_stats where table_name='orders') /
+(select avg_frequency from mysql.index_stats
where index_name='i_o_orderdate' and prefix_arity=1) as n_distinct;
n_distinct
1126.0416
select count(distinct o_orderdate) from orders;
count(distinct o_orderdate)
1126
-select (select cardinality from mysql.table_stat where table_name='orders') /
-(select avg_frequency from mysql.index_stat
+select (select cardinality from mysql.table_stats where table_name='orders') /
+(select avg_frequency from mysql.index_stats
where index_name='i_o_custkey' and prefix_arity=1) as n_distinct;
n_distinct
100.0000
diff --git a/mysql-test/r/stat_tables_par.result b/mysql-test/r/stat_tables_par.result
index 19ecb907a66..c5ae92456b7 100644
--- a/mysql-test/r/stat_tables_par.result
+++ b/mysql-test/r/stat_tables_par.result
@@ -5,7 +5,7 @@ CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
-select * from mysql.table_stat;
+select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
@@ -15,7 +15,7 @@ dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
-select * from mysql.index_stat;
+select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
@@ -80,7 +80,7 @@ revenue
77949.91860000002
set use_stat_tables='preferably';
set debug_sync='RESET';
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -94,10 +94,10 @@ dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
-delete from mysql.index_stat
+delete from mysql.index_stats
where table_name='lineitem' and
index_name in ('i_l_shipdate', 'i_l_receiptdate');
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -110,7 +110,7 @@ dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -123,9 +123,9 @@ dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
-delete from mysql.index_stat
+delete from mysql.index_stats
where table_name='lineitem' and index_name= 'i_l_shipdate';
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -148,7 +148,7 @@ use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
set debug_sync='RESET';
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
diff --git a/mysql-test/r/stat_tables_par_innodb.result b/mysql-test/r/stat_tables_par_innodb.result
index dc290c78dd9..7d73838ed37 100644
--- a/mysql-test/r/stat_tables_par_innodb.result
+++ b/mysql-test/r/stat_tables_par_innodb.result
@@ -8,7 +8,7 @@ CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
-select * from mysql.table_stat;
+select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
@@ -18,7 +18,7 @@ dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
-select * from mysql.index_stat;
+select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
@@ -83,7 +83,7 @@ revenue
77949.91860000002
set use_stat_tables='preferably';
set debug_sync='RESET';
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -97,10 +97,10 @@ dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
-delete from mysql.index_stat
+delete from mysql.index_stats
where table_name='lineitem' and
index_name in ('i_l_shipdate', 'i_l_receiptdate');
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -113,7 +113,7 @@ dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -126,9 +126,9 @@ dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
-delete from mysql.index_stat
+delete from mysql.index_stats
where table_name='lineitem' and index_name= 'i_l_shipdate';
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
@@ -151,7 +151,7 @@ use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
set debug_sync='RESET';
-select * from mysql.index_stat where table_name='lineitem' order by index_name;
+select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result
index 5a163ca3f84..ecb252d4c01 100644
--- a/mysql-test/r/statistics.result
+++ b/mysql-test/r/statistics.result
@@ -1,8 +1,8 @@
drop table if exists t1,t2;
set @save_use_stat_tables=@@use_stat_tables;
-DELETE FROM mysql.table_stat;
-DELETE FROM mysql.column_stat;
-DELETE FROM mysql.index_stat;
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
set use_stat_tables='preferably';
CREATE TABLE t1 (
a int NOT NULL PRIMARY KEY,
@@ -60,10 +60,10 @@ INSERT INTO t1 VALUES
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -71,7 +71,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx1 1 6.4000
@@ -85,7 +85,7 @@ test t1 idx4 3 1.1304
SELECT COUNT(*) FROM t1;
COUNT(*)
40
-SELECT * FROM mysql.column_stat
+SELECT * FROM mysql.column_stats
WHERE db_name='test' AND table_name='t1' AND column_name='a';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
@@ -97,7 +97,7 @@ SELECT MIN(t1.a), MAX(t1.a),
FROM t1;
MIN(t1.a) MAX(t1.a) NULLS_RATIO(t1.a) AVG_FREQUENCY(t1.a)
0 49 0.2000 1.0000
-SELECT * FROM mysql.column_stat
+SELECT * FROM mysql.column_stats
WHERE db_name='test' AND table_name='t1' AND column_name='b';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -109,7 +109,7 @@ SELECT MIN(t1.b), MAX(t1.b),
FROM t1;
MIN(t1.b) MAX(t1.b) NULLS_RATIO(t1.b) AVG_FREQUENCY(t1.b)
vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 6.4000
-SELECT * FROM mysql.column_stat
+SELECT * FROM mysql.column_stats
WHERE db_name='test' AND table_name='t1' AND column_name='c';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
@@ -121,7 +121,7 @@ SELECT MIN(t1.c), MAX(t1.c),
FROM t1;
MIN(t1.c) MAX(t1.c) NULLS_RATIO(t1.c) AVG_FREQUENCY(t1.c)
aaaa dddddddd 0.1250 7.0000
-SELECT * FROM mysql.column_stat
+SELECT * FROM mysql.column_stats
WHERE db_name='test' AND table_name='t1' AND column_name='d';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
@@ -133,7 +133,7 @@ SELECT MIN(t1.d), MAX(t1.d),
FROM t1;
MIN(t1.d) MAX(t1.d) NULLS_RATIO(t1.d) AVG_FREQUENCY(t1.d)
1989-03-12 1999-07-23 0.1500 8.5000
-SELECT * FROM mysql.column_stat
+SELECT * FROM mysql.column_stats
WHERE db_name='test' AND table_name='t1' AND column_name='e';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
@@ -145,7 +145,7 @@ SELECT MIN(t1.e), MAX(t1.e),
FROM t1;
MIN(t1.e) MAX(t1.e) NULLS_RATIO(t1.e) AVG_FREQUENCY(t1.e)
0.01 0.112 0.2250 6.2000
-SELECT * FROM mysql.index_stat
+SELECT * FROM mysql.index_stats
WHERE db_name='test' AND table_name='t1' AND index_name='idx1';
db_name table_name index_name prefix_arity avg_frequency
test t1 idx1 1 6.4000
@@ -160,7 +160,7 @@ WHERE t1.b IS NOT NULL AND t1.e IS NOT NULL)
AS 'ARITY 2';
ARITY 1 ARITY 2
6.4000 1.6875
-SELECT * FROM mysql.index_stat
+SELECT * FROM mysql.index_stats
WHERE db_name='test' AND table_name='t1' AND index_name='idx2';
db_name table_name index_name prefix_arity avg_frequency
test t1 idx2 1 7.0000
@@ -175,7 +175,7 @@ WHERE t1.c IS NOT NULL AND t1.d IS NOT NULL)
AS 'ARITY 2';
ARITY 1 ARITY 2
7.0000 2.3846
-SELECT * FROM mysql.index_stat
+SELECT * FROM mysql.index_stats
WHERE db_name='test' AND table_name='t1' AND index_name='idx3';
db_name table_name index_name prefix_arity avg_frequency
test t1 idx3 1 8.5000
@@ -185,7 +185,7 @@ SELECT
AS 'ARITY 1';
ARITY 1
8.5000
-SELECT * FROM mysql.index_stat
+SELECT * FROM mysql.index_stats
WHERE db_name='test' AND table_name='t1' AND index_name='idx4';
db_name table_name index_name prefix_arity avg_frequency
test t1 idx4 1 6.2000
@@ -233,11 +233,11 @@ INSERT INTO t3 VALUES
ANALYZE TABLE t3;
Table Op Msg_type Msg_text
test.t3 analyze status OK
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
test t3 17
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -248,7 +248,7 @@ test t1 f 1 5 0.2000 1.0000 6.4000
test t3 a 0 38 0.0000 4.0000 1.0000
test t3 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.1765 18.0714 2.8000
test t3 c aaaa dddddddd 0.1176 6.4000 3.7500
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx1 1 6.4000
@@ -262,11 +262,11 @@ test t1 idx4 3 1.1304
test t3 PRIMARY 1 1.0000
test t3 idx 1 3.7500
ALTER TABLE t1 RENAME TO s1;
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test s1 40
test t3 17
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test s1 a 0 49 0.0000 4.0000 1.0000
test s1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -277,7 +277,7 @@ test s1 f 1 5 0.2000 1.0000 6.4000
test t3 a 0 38 0.0000 4.0000 1.0000
test t3 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.1765 18.0714 2.8000
test t3 c aaaa dddddddd 0.1176 6.4000 3.7500
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test s1 PRIMARY 1 1.0000
test s1 idx1 1 6.4000
@@ -291,11 +291,11 @@ test s1 idx4 3 1.1304
test t3 PRIMARY 1 1.0000
test t3 idx 1 3.7500
RENAME TABLE s1 TO t1;
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
test t3 17
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -306,7 +306,7 @@ test t1 f 1 5 0.2000 1.0000 6.4000
test t3 a 0 38 0.0000 4.0000 1.0000
test t3 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.1765 18.0714 2.8000
test t3 c aaaa dddddddd 0.1176 6.4000 3.7500
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx1 1 6.4000
@@ -320,10 +320,10 @@ test t1 idx4 3 1.1304
test t3 PRIMARY 1 1.0000
test t3 idx 1 3.7500
DROP TABLE t3;
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -331,7 +331,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx1 1 6.4000
@@ -364,7 +364,7 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`y`,`x`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 x vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -389,7 +389,7 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`b`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -413,10 +413,10 @@ s1 CREATE TABLE `s1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`x`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test s1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test s1 a 0 49 0.0000 4.0000 1.0000
test s1 x vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -424,7 +424,7 @@ test s1 c aaaa dddddddd 0.1250 6.6571 7.0000
test s1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test s1 e 0.01 0.112 0.2250 8.0000 6.2000
test s1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test s1 PRIMARY 1 1.0000
test s1 idx1 1 6.4000
@@ -451,10 +451,10 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`b`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -462,7 +462,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx1 1 6.4000
@@ -489,14 +489,14 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`x`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx1 1 6.4000
@@ -523,14 +523,14 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`b`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx2 1 7.0000
@@ -539,7 +539,7 @@ test t1 idx3 1 8.5000
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx4);
Table Op Msg_type Msg_text
test.t1 analyze status OK
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -547,7 +547,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx4 3 1.1304
@@ -558,12 +558,12 @@ test t1 idx3 1 8.5000
test t1 idx4 1 6.2000
test t1 idx1 2 1.6875
test t1 idx1 1 6.4000
-SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/save_column_stat'
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/save_column_stats'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
- FROM mysql.column_stat WHERE column_name='b';
-SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/save_index_stat'
+ FROM mysql.column_stats WHERE column_name='b';
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/save_index_stats'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
- FROM mysql.index_stat WHERE index_name IN ('idx1', 'idx4');
+ FROM mysql.index_stats WHERE index_name IN ('idx1', 'idx4');
ALTER TABLE t1 CHANGE COLUMN b x varchar(30);
SHOW CREATE TABLE t1;
Table Create Table
@@ -580,14 +580,14 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`x`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx4 3 1.1304
@@ -614,26 +614,26 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`b`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx2 1 7.0000
test t1 idx2 2 2.3846
test t1 idx3 1 8.5000
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/save_column_stat'
- INTO TABLE mysql.column_stat
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/save_column_stats'
+ INTO TABLE mysql.column_stats
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/save_index_stat'
- INTO TABLE mysql.index_stat
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/save_index_stats'
+ INTO TABLE mysql.index_stats
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -641,7 +641,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx4 3 1.1304
@@ -667,14 +667,14 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx2 1 7.0000
@@ -694,7 +694,7 @@ t1 CREATE TABLE `t1` (
KEY `idx3` (`d`),
KEY `idx4` (`e`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx3 1 8.5000
@@ -730,21 +730,21 @@ t1 CREATE TABLE `t1` (
KEY `idx2` (`c`,`d`),
KEY `idx4` (`e`,`b`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx3 1 8.5000
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx2, idx4);
Table Op Msg_type Msg_text
test.t1 analyze status OK
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b NULL NULL 1.0000 NULL NULL
@@ -752,7 +752,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx2 1 7.0000
@@ -767,7 +767,7 @@ UPDATE t1 SET b=(SELECT b FROM t0 WHERE t0.a= t1.a);
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx2, idx4);
Table Op Msg_type Msg_text
test.t1 analyze status OK
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -775,7 +775,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx2 1 7.0000
@@ -799,14 +799,14 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a`),
KEY `idx3` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx3 1 8.5000
@@ -829,21 +829,21 @@ t1 CREATE TABLE `t1` (
KEY `idx2` (`c`,`d`),
KEY `idx4` (`e`,`b`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx3 1 8.5000
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx2, idx4);
Table Op Msg_type Msg_text
test.t1 analyze status OK
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
@@ -851,7 +851,7 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx4 1 6.2000
@@ -862,39 +862,39 @@ test t1 idx2 1 7.0000
test t1 idx1 2 1.6875
test t1 idx1 1 6.4000
test t1 idx4 3 1.1304
-DELETE FROM mysql.table_stat;
-DELETE FROM mysql.column_stat;
-DELETE FROM mysql.index_stat;
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS() INDEXES();
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(c,e,b) INDEXES(idx2,idx4);
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 idx2 1 7.0000
test t1 idx2 2 2.3846
test t1 idx4 1 6.2000
test t1 idx4 2 1.6875
test t1 idx4 3 1.1304
-DELETE FROM mysql.index_stat WHERE table_name='t1' AND index_name='primary';
-SELECT * FROM mysql.index_stat;
+DELETE FROM mysql.index_stats WHERE table_name='t1' AND index_name='primary';
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 idx2 1 7.0000
test t1 idx2 2 2.3846
@@ -904,7 +904,7 @@ test t1 idx4 3 1.1304
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS() INDEXES(primary);
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 idx2 1 7.0000
test t1 idx2 2 2.3846
@@ -912,16 +912,16 @@ test t1 idx4 1 6.2000
test t1 idx4 2 1.6875
test t1 idx4 3 1.1304
test t1 PRIMARY 1 1.0000
-DELETE FROM mysql.table_stat;
-DELETE FROM mysql.column_stat;
-DELETE FROM mysql.index_stat;
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS ALL INDEXES ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
@@ -929,7 +929,7 @@ test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
test t1 b vvvvvvvvvvvvv zzzzzzzzzzzzzzzzzz 0.2000 17.1250 6.4000
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx3 1 8.5000
@@ -946,11 +946,11 @@ INSERT INTO t2 SELECT * FROM t1;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
-SELECT * FROM mysql.table_stat;
+SELECT * FROM mysql.table_stats;
db_name table_name cardinality
test t1 40
test t2 40
-SELECT * FROM mysql.column_stat ORDER BY column_name;
+SELECT * FROM mysql.column_stats ORDER BY column_name;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t2 a 0 49 0.0000 4.0000 1.0000
@@ -964,7 +964,7 @@ test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t2 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
test t2 f 1 5 0.2000 1.0000 6.4000
-SELECT * FROM mysql.index_stat ORDER BY index_name, prefix_arity, table_name;
+SELECT * FROM mysql.index_stats ORDER BY index_name, prefix_arity, table_name;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t2 PRIMARY 1 1.0000
@@ -984,9 +984,9 @@ test t1 idx4 2 1.6875
test t2 idx4 2 1.6875
test t1 idx4 3 1.1304
test t2 idx4 3 1.1304
-DELETE FROM mysql.table_stat;
-DELETE FROM mysql.column_stat;
-DELETE FROM mysql.index_stat;
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
ALTER TABLE t1
DROP INDEX idx1,
DROP INDEX idx4;
@@ -997,7 +997,7 @@ ADD INDEX idx4 (e, b(4), d);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
-SELECT * FROM mysql.column_stat;
+SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency
test t1 a 0 49 0.0000 4.0000 1.0000
test t1 c aaaa dddddddd 0.1250 6.6571 7.0000
@@ -1005,7 +1005,7 @@ test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000
test t1 e 0.01 0.112 0.2250 8.0000 6.2000
test t1 f 1 5 0.2000 1.0000 6.4000
test t1 b NULL NULL 0.2000 17.1250 NULL
-SELECT * FROM mysql.index_stat;
+SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
test t1 idx3 1 8.5000
@@ -1017,9 +1017,9 @@ test t1 idx4 1 6.2000
test t1 idx4 2 NULL
test t1 idx4 3 NULL
DROP TABLE t1,t2;
-DELETE FROM mysql.table_stat;
-DELETE FROM mysql.column_stat;
-DELETE FROM mysql.index_stat;
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
set use_stat_tables='never';
set names utf8;
CREATE DATABASE world;
@@ -1052,14 +1052,14 @@ INDEX (Percentage)
set use_stat_tables='preferably';
ANALYZE TABLE Country, City, CountryLanguage;
SELECT UPPER(db_name), UPPER(table_name), cardinality
-FROM mysql.table_stat;
+FROM mysql.table_stats;
UPPER(db_name) UPPER(table_name) cardinality
WORLD COUNTRY 239
WORLD CITY 4079
WORLD COUNTRYLANGUAGE 984
SELECT UPPER(db_name), UPPER(table_name),
column_name, min_value, max_value, nulls_ratio, avg_length, avg_frequency
-FROM mysql.column_stat;
+FROM mysql.column_stats;
UPPER(db_name) UPPER(table_name) column_name min_value max_value nulls_ratio avg_length avg_frequency
WORLD COUNTRY Code ABW ZWE 0.0000 3.0000 1.0000
WORLD COUNTRY Name Afghanistan Zimbabwe 0.0000 10.1088 1.0000
@@ -1075,7 +1075,7 @@ WORLD COUNTRYLANGUAGE Language Abhyasi [South]Mande 0.0000 7.1778 2.1532
WORLD COUNTRYLANGUAGE Percentage 0.0 99.9 0.0000 4.0000 2.7640
SELECT UPPER(db_name), UPPER(table_name),
index_name, prefix_arity, avg_frequency
-FROM mysql.index_stat;
+FROM mysql.index_stats;
UPPER(db_name) UPPER(table_name) index_name prefix_arity avg_frequency
WORLD COUNTRY PRIMARY 1 1.0000
WORLD COUNTRY Name 1 1.0000
@@ -1120,7 +1120,7 @@ ALTER TABLE CountryLanguage ENGINE=InnoDB;
set use_stat_tables='preferably';
ANALYZE TABLE Country, City, CountryLanguage;
SELECT UPPER(db_name), UPPER(table_name), cardinality
-FROM mysql.table_stat;
+FROM mysql.table_stats;
UPPER(db_name) UPPER(table_name) cardinality
WORLD COUNTRY 239
WORLD CITY 4079
@@ -1130,7 +1130,7 @@ WORLD_INNODB CITY 4079
WORLD_INNODB COUNTRYLANGUAGE 984
SELECT UPPER(db_name), UPPER(table_name),
column_name, min_value, max_value, nulls_ratio, avg_length, avg_frequency
-FROM mysql.column_stat;
+FROM mysql.column_stats;
UPPER(db_name) UPPER(table_name) column_name min_value max_value nulls_ratio avg_length avg_frequency
WORLD COUNTRY Code ABW ZWE 0.0000 3.0000 1.0000
WORLD COUNTRY Name Afghanistan Zimbabwe 0.0000 10.1088 1.0000
@@ -1158,7 +1158,7 @@ WORLD_INNODB COUNTRYLANGUAGE Language Abhyasi [South]Mande 0.0000 7.1778 2.1532
WORLD_INNODB COUNTRYLANGUAGE Percentage 0.0 99.9 0.0000 4.0000 2.7640
SELECT UPPER(db_name), UPPER(table_name),
index_name, prefix_arity, avg_frequency
-FROM mysql.index_stat;
+FROM mysql.index_stats;
UPPER(db_name) UPPER(table_name) index_name prefix_arity avg_frequency
WORLD COUNTRY PRIMARY 1 1.0000
WORLD COUNTRY Name 1 1.0000
@@ -1179,14 +1179,14 @@ WORLD_INNODB COUNTRYLANGUAGE Percentage 1 2.7640
use test;
DROP DATABASE world;
SELECT UPPER(db_name), UPPER(table_name), cardinality
-FROM mysql.table_stat;
+FROM mysql.table_stats;
UPPER(db_name) UPPER(table_name) cardinality
WORLD_INNODB COUNTRY 239
WORLD_INNODB CITY 4079
WORLD_INNODB COUNTRYLANGUAGE 984
SELECT UPPER(db_name), UPPER(table_name),
column_name, min_value, max_value, nulls_ratio, avg_length, avg_frequency
-FROM mysql.column_stat;
+FROM mysql.column_stats;
UPPER(db_name) UPPER(table_name) column_name min_value max_value nulls_ratio avg_length avg_frequency
WORLD_INNODB COUNTRY Code ABW ZWE 0.0000 3.0000 1.0000
WORLD_INNODB COUNTRY Name Afghanistan Zimbabwe 0.0000 10.1088 1.0000
@@ -1202,7 +1202,7 @@ WORLD_INNODB COUNTRYLANGUAGE Language Abhyasi [South]Mande 0.0000 7.1778 2.1532
WORLD_INNODB COUNTRYLANGUAGE Percentage 0.0 99.9 0.0000 4.0000 2.7640
SELECT UPPER(db_name), UPPER(table_name),
index_name, prefix_arity, avg_frequency
-FROM mysql.index_stat;
+FROM mysql.index_stats;
UPPER(db_name) UPPER(table_name) index_name prefix_arity avg_frequency
WORLD_INNODB COUNTRY PRIMARY 1 1.0000
WORLD_INNODB COUNTRY Name 1 1.0000
@@ -1214,17 +1214,17 @@ WORLD_INNODB COUNTRYLANGUAGE PRIMARY 2 1.0000
WORLD_INNODB COUNTRYLANGUAGE Percentage 1 2.7640
DROP DATABASE world_innodb;
SELECT UPPER(db_name), UPPER(table_name), cardinality
-FROM mysql.table_stat;
+FROM mysql.table_stats;
UPPER(db_name) UPPER(table_name) cardinality
SELECT UPPER(db_name), UPPER(table_name),
column_name, min_value, max_value, nulls_ratio, avg_length, avg_frequency
-FROM mysql.column_stat;
+FROM mysql.column_stats;
UPPER(db_name) UPPER(table_name) column_name min_value max_value nulls_ratio avg_length avg_frequency
SELECT UPPER(db_name), UPPER(table_name),
index_name, prefix_arity, avg_frequency
-FROM mysql.index_stat;
+FROM mysql.index_stats;
UPPER(db_name) UPPER(table_name) index_name prefix_arity avg_frequency
-DELETE FROM mysql.table_stat;
-DELETE FROM mysql.column_stat;
-DELETE FROM mysql.index_stat;
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index cf7db8f64ff..d5e79e9e728 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -1,6 +1,6 @@
show tables;
Tables_in_db
-column_stat
+column_stats
columns_priv
db
event
@@ -11,7 +11,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -19,7 +19,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -267,17 +267,17 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
-show create table table_stat;
+show create table table_stats;
Table Create Table
-table_stat CREATE TABLE `table_stat` (
+table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
-show create table column_stat;
+show create table column_stats;
Table Create Table
-column_stat CREATE TABLE `column_stat` (
+column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
@@ -288,9 +288,9 @@ column_stat CREATE TABLE `column_stat` (
`avg_frequency` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
-show create table index_stat;
+show create table index_stats;
Table Create Table
-index_stat CREATE TABLE `index_stat` (
+index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
diff --git a/mysql-test/r/system_mysql_db_fix40123.result b/mysql-test/r/system_mysql_db_fix40123.result
index 985fbd0539d..07e9d6b0e87 100644
--- a/mysql-test/r/system_mysql_db_fix40123.result
+++ b/mysql-test/r/system_mysql_db_fix40123.result
@@ -1,6 +1,6 @@
show tables;
Tables_in_db
-column_stat
+column_stats
columns_priv
db
event
@@ -11,7 +11,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -19,7 +19,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -267,17 +267,17 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
-show create table table_stat;
+show create table table_stats;
Table Create Table
-table_stat CREATE TABLE `table_stat` (
+table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
-show create table column_stat;
+show create table column_stats;
Table Create Table
-column_stat CREATE TABLE `column_stat` (
+column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
@@ -288,9 +288,9 @@ column_stat CREATE TABLE `column_stat` (
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
-show create table index_stat;
+show create table index_stats;
Table Create Table
-index_stat CREATE TABLE `index_stat` (
+index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
diff --git a/mysql-test/r/system_mysql_db_fix50030.result b/mysql-test/r/system_mysql_db_fix50030.result
index 985fbd0539d..07e9d6b0e87 100644
--- a/mysql-test/r/system_mysql_db_fix50030.result
+++ b/mysql-test/r/system_mysql_db_fix50030.result
@@ -1,6 +1,6 @@
show tables;
Tables_in_db
-column_stat
+column_stats
columns_priv
db
event
@@ -11,7 +11,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -19,7 +19,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -267,17 +267,17 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
-show create table table_stat;
+show create table table_stats;
Table Create Table
-table_stat CREATE TABLE `table_stat` (
+table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
-show create table column_stat;
+show create table column_stats;
Table Create Table
-column_stat CREATE TABLE `column_stat` (
+column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
@@ -288,9 +288,9 @@ column_stat CREATE TABLE `column_stat` (
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
-show create table index_stat;
+show create table index_stats;
Table Create Table
-index_stat CREATE TABLE `index_stat` (
+index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
diff --git a/mysql-test/r/system_mysql_db_fix50117.result b/mysql-test/r/system_mysql_db_fix50117.result
index 985fbd0539d..07e9d6b0e87 100644
--- a/mysql-test/r/system_mysql_db_fix50117.result
+++ b/mysql-test/r/system_mysql_db_fix50117.result
@@ -1,6 +1,6 @@
show tables;
Tables_in_db
-column_stat
+column_stats
columns_priv
db
event
@@ -11,7 +11,7 @@ help_keyword
help_relation
help_topic
host
-index_stat
+index_stats
ndb_binlog_index
plugin
proc
@@ -19,7 +19,7 @@ procs_priv
proxies_priv
servers
slow_log
-table_stat
+table_stats
tables_priv
time_zone
time_zone_leap_second
@@ -267,17 +267,17 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
-show create table table_stat;
+show create table table_stats;
Table Create Table
-table_stat CREATE TABLE `table_stat` (
+table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
-show create table column_stat;
+show create table column_stats;
Table Create Table
-column_stat CREATE TABLE `column_stat` (
+column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
@@ -288,9 +288,9 @@ column_stat CREATE TABLE `column_stat` (
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
-show create table index_stat;
+show create table index_stats;
Table Create Table
-index_stat CREATE TABLE `index_stat` (
+index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,