mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
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.
This commit is contained in:
parent
f8bfb65b13
commit
b110132516
38 changed files with 621 additions and 620 deletions
|
@ -1,5 +1,5 @@
|
|||
if (`select count(*) < 3 from information_schema.tables
|
||||
where table_schema = 'mysql' and table_name in ('table_stat','column_stat','index_stat')`)
|
||||
where table_schema = 'mysql' and table_name in ('table_stats','column_stats','index_stats')`)
|
||||
{
|
||||
--skip Needs stat tables
|
||||
}
|
||||
|
|
|
@ -16,6 +16,6 @@ show create table proc;
|
|||
show create table event;
|
||||
show create table general_log;
|
||||
show create table slow_log;
|
||||
show create table table_stat;
|
||||
show create table column_stat;
|
||||
show create table index_stat;
|
||||
show create table table_stats;
|
||||
show create table column_stats;
|
||||
show create table index_stats;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -9,14 +9,14 @@ def mysql columns_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(
|
|||
def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||
def mysql columns_priv User 3 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
def mysql column_stat avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql column_stat avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql column_stat column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql column_stat db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql column_stat max_value 5 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references
|
||||
def mysql column_stat min_value 4 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references
|
||||
def mysql column_stat nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql column_stat table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql column_stats max_value 5 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references
|
||||
def mysql column_stats min_value 4 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references
|
||||
def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql column_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql db Alter_priv 13 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql db Create_priv 8 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
|
@ -105,11 +105,11 @@ def mysql host Select_priv 3 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci e
|
|||
def mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql host Update_priv 5 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql index_stat avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql index_stat db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql index_stat index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql index_stat prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI select,insert,update,references
|
||||
def mysql index_stat table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql index_stats avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
|
||||
def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI select,insert,update,references
|
||||
def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
|
||||
def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references
|
||||
def mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL NULL latin1 latin1_swedish_ci varchar(255) select,insert,update,references
|
||||
|
@ -182,9 +182,9 @@ def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin
|
|||
def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') select,insert,update,references
|
||||
def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||
def mysql tables_priv User 3 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
def mysql table_stat cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references
|
||||
def mysql table_stat db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql table_stat table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references
|
||||
def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
|
||||
def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI auto_increment select,insert,update,references
|
||||
def mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('Y','N') select,insert,update,references
|
||||
def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
|
||||
|
@ -320,14 +320,14 @@ COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH C
|
|||
3.0000 mysql columns_priv Column_name char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql columns_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql columns_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
3.0000 mysql column_stat db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stat table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stat column_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stat min_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
3.0000 mysql column_stat max_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
NULL mysql column_stat nulls_ratio decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stat avg_length decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stat avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
3.0000 mysql column_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stats column_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stats min_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
3.0000 mysql column_stats max_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
NULL mysql column_stats nulls_ratio decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stats avg_length decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
3.0000 mysql db Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql db Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql db User char 16 48 utf8 utf8_bin char(16)
|
||||
|
@ -416,11 +416,11 @@ NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5)
|
|||
3.0000 mysql host Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql index_stat db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stat table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stat index_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql index_stat prefix_arity int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql index_stat avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
3.0000 mysql index_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stats index_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql index_stats prefix_arity int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql index_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql ndb_binlog_index Position bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
1.0000 mysql ndb_binlog_index File varchar 255 255 latin1 latin1_swedish_ci varchar(255)
|
||||
NULL mysql ndb_binlog_index epoch bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
|
@ -493,9 +493,9 @@ NULL mysql slow_log server_id int NULL NULL NULL NULL int(10) unsigned
|
|||
NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql tables_priv Table_priv set 98 294 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
|
||||
3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
3.0000 mysql table_stat db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql table_stat table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql table_stat cardinality bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 mysql table_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql table_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql table_stats cardinality bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL mysql time_zone Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql time_zone Use_leap_seconds enum 1 3 utf8 utf8_general_ci enum('Y','N')
|
||||
NULL mysql time_zone_leap_second Transition_time bigint NULL NULL NULL NULL bigint(20)
|
||||
|
|
|
@ -9,14 +9,14 @@ def mysql columns_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(
|
|||
def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI
|
||||
def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
def mysql columns_priv User 3 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI
|
||||
def mysql column_stat avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql column_stat avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql column_stat column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql column_stat db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql column_stat max_value 5 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255)
|
||||
def mysql column_stat min_value 4 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255)
|
||||
def mysql column_stat nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql column_stat table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql column_stats max_value 5 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255)
|
||||
def mysql column_stats min_value 4 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255)
|
||||
def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql column_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql db Alter_priv 13 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
def mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
def mysql db Create_priv 8 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
|
@ -105,11 +105,11 @@ def mysql host Select_priv 3 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci e
|
|||
def mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
def mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
def mysql host Update_priv 5 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
def mysql index_stat avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql index_stat db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql index_stat index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql index_stat prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI
|
||||
def mysql index_stat table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql index_stats avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
|
||||
def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI
|
||||
def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned
|
||||
def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI
|
||||
def mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL NULL latin1 latin1_swedish_ci varchar(255)
|
||||
|
@ -182,9 +182,9 @@ def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin
|
|||
def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
|
||||
def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
def mysql tables_priv User 3 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI
|
||||
def mysql table_stat cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
|
||||
def mysql table_stat db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql table_stat table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
|
||||
def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI
|
||||
def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI auto_increment
|
||||
def mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('Y','N')
|
||||
def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
|
||||
|
@ -320,14 +320,14 @@ COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH C
|
|||
3.0000 mysql columns_priv Column_name char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql columns_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql columns_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
3.0000 mysql column_stat db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stat table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stat column_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stat min_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
3.0000 mysql column_stat max_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
NULL mysql column_stat nulls_ratio decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stat avg_length decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stat avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
3.0000 mysql column_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stats column_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql column_stats min_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
3.0000 mysql column_stats max_value varchar 255 765 utf8 utf8_bin varchar(255)
|
||||
NULL mysql column_stats nulls_ratio decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stats avg_length decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql column_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
3.0000 mysql db Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql db Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql db User char 16 48 utf8 utf8_bin char(16)
|
||||
|
@ -416,11 +416,11 @@ NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5)
|
|||
3.0000 mysql host Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql index_stat db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stat table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stat index_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql index_stat prefix_arity int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql index_stat avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
3.0000 mysql index_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql index_stats index_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql index_stats prefix_arity int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql index_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
|
||||
NULL mysql ndb_binlog_index Position bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
1.0000 mysql ndb_binlog_index File varchar 255 255 latin1 latin1_swedish_ci varchar(255)
|
||||
NULL mysql ndb_binlog_index epoch bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
|
@ -493,9 +493,9 @@ NULL mysql slow_log server_id int NULL NULL NULL NULL int(10) unsigned
|
|||
NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql tables_priv Table_priv set 98 294 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
|
||||
3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
3.0000 mysql table_stat db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql table_stat table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql table_stat cardinality bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 mysql table_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
3.0000 mysql table_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
|
||||
NULL mysql table_stats cardinality bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL mysql time_zone Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql time_zone Use_leap_seconds enum 1 3 utf8 utf8_general_ci enum('Y','N')
|
||||
NULL mysql time_zone_leap_second Transition_time bigint NULL NULL NULL NULL bigint(20)
|
||||
|
|
|
@ -75,9 +75,9 @@ table_schema, table_name, column_name
|
|||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
|
||||
constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name
|
||||
def mysql PRIMARY def mysql column_stat db_name
|
||||
def mysql PRIMARY def mysql column_stat table_name
|
||||
def mysql PRIMARY def mysql column_stat column_name
|
||||
def mysql PRIMARY def mysql column_stats db_name
|
||||
def mysql PRIMARY def mysql column_stats table_name
|
||||
def mysql PRIMARY def mysql column_stats column_name
|
||||
def mysql PRIMARY def mysql columns_priv Host
|
||||
def mysql PRIMARY def mysql columns_priv Db
|
||||
def mysql PRIMARY def mysql columns_priv User
|
||||
|
@ -99,10 +99,10 @@ def mysql PRIMARY def mysql help_topic help_topic_id
|
|||
def mysql name def mysql help_topic name
|
||||
def mysql PRIMARY def mysql host Host
|
||||
def mysql PRIMARY def mysql host Db
|
||||
def mysql PRIMARY def mysql index_stat db_name
|
||||
def mysql PRIMARY def mysql index_stat table_name
|
||||
def mysql PRIMARY def mysql index_stat index_name
|
||||
def mysql PRIMARY def mysql index_stat prefix_arity
|
||||
def mysql PRIMARY def mysql index_stats db_name
|
||||
def mysql PRIMARY def mysql index_stats table_name
|
||||
def mysql PRIMARY def mysql index_stats index_name
|
||||
def mysql PRIMARY def mysql index_stats prefix_arity
|
||||
def mysql PRIMARY def mysql ndb_binlog_index epoch
|
||||
def mysql PRIMARY def mysql plugin name
|
||||
def mysql PRIMARY def mysql proc db
|
||||
|
@ -118,8 +118,8 @@ def mysql PRIMARY def mysql proxies_priv User
|
|||
def mysql PRIMARY def mysql proxies_priv Proxied_host
|
||||
def mysql PRIMARY def mysql proxies_priv Proxied_user
|
||||
def mysql PRIMARY def mysql servers Server_name
|
||||
def mysql PRIMARY def mysql table_stat db_name
|
||||
def mysql PRIMARY def mysql table_stat table_name
|
||||
def mysql PRIMARY def mysql table_stats db_name
|
||||
def mysql PRIMARY def mysql table_stats table_name
|
||||
def mysql PRIMARY def mysql tables_priv Host
|
||||
def mysql PRIMARY def mysql tables_priv Db
|
||||
def mysql PRIMARY def mysql tables_priv User
|
||||
|
|
|
@ -85,9 +85,9 @@ INDEX_COMMENT varchar(1024) NO
|
|||
SELECT table_catalog, table_schema, table_name, index_schema, index_name
|
||||
FROM information_schema.statistics WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name index_schema index_name
|
||||
def mysql column_stat mysql PRIMARY
|
||||
def mysql column_stat mysql PRIMARY
|
||||
def mysql column_stat mysql PRIMARY
|
||||
def mysql column_stats mysql PRIMARY
|
||||
def mysql column_stats mysql PRIMARY
|
||||
def mysql column_stats mysql PRIMARY
|
||||
def mysql columns_priv mysql PRIMARY
|
||||
def mysql columns_priv mysql PRIMARY
|
||||
def mysql columns_priv mysql PRIMARY
|
||||
|
@ -110,10 +110,10 @@ def mysql help_topic mysql PRIMARY
|
|||
def mysql help_topic mysql name
|
||||
def mysql host mysql PRIMARY
|
||||
def mysql host mysql PRIMARY
|
||||
def mysql index_stat mysql PRIMARY
|
||||
def mysql index_stat mysql PRIMARY
|
||||
def mysql index_stat mysql PRIMARY
|
||||
def mysql index_stat mysql PRIMARY
|
||||
def mysql index_stats mysql PRIMARY
|
||||
def mysql index_stats mysql PRIMARY
|
||||
def mysql index_stats mysql PRIMARY
|
||||
def mysql index_stats mysql PRIMARY
|
||||
def mysql ndb_binlog_index mysql PRIMARY
|
||||
def mysql plugin mysql PRIMARY
|
||||
def mysql proc mysql PRIMARY
|
||||
|
@ -131,8 +131,8 @@ def mysql proxies_priv mysql PRIMARY
|
|||
def mysql proxies_priv mysql PRIMARY
|
||||
def mysql proxies_priv mysql Grantor
|
||||
def mysql servers mysql PRIMARY
|
||||
def mysql table_stat mysql PRIMARY
|
||||
def mysql table_stat mysql PRIMARY
|
||||
def mysql table_stats mysql PRIMARY
|
||||
def mysql table_stats mysql PRIMARY
|
||||
def mysql tables_priv mysql PRIMARY
|
||||
def mysql tables_priv mysql PRIMARY
|
||||
def mysql tables_priv mysql PRIMARY
|
||||
|
|
|
@ -12,9 +12,9 @@ def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
|||
def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 3 column_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 3 column_name A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
|
@ -32,10 +32,10 @@ def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
|||
def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
|
||||
def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 3 index_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 4 prefix_arity A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 3 index_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 4 prefix_arity A #CARD# NULL NULL BTREE
|
||||
def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
|
||||
def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
|
@ -58,8 +58,8 @@ def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
|||
def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
|
||||
|
|
|
@ -12,9 +12,9 @@ def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
|||
def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 3 column_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 3 column_name A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
|
@ -32,10 +32,10 @@ def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
|||
def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
|
||||
def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 3 index_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 4 prefix_arity A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 3 index_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 4 prefix_arity A #CARD# NULL NULL BTREE
|
||||
def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
|
||||
def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
|
@ -58,8 +58,8 @@ def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
|||
def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
|
||||
|
@ -79,9 +79,9 @@ def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
|||
def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stat 0 mysql PRIMARY 3 column_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql column_stats 0 mysql PRIMARY 3 column_name A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
|
@ -99,10 +99,10 @@ def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
|||
def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
|
||||
def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 3 index_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stat 0 mysql PRIMARY 4 prefix_arity A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 3 index_name A #CARD# NULL NULL BTREE
|
||||
def mysql index_stats 0 mysql PRIMARY 4 prefix_arity A #CARD# NULL NULL BTREE
|
||||
def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
|
||||
def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
|
@ -125,8 +125,8 @@ def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
|||
def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stat 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stat 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stats 0 mysql PRIMARY 1 db_name A #CARD# NULL NULL BTREE
|
||||
def mysql table_stats 0 mysql PRIMARY 2 table_name A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
|
||||
def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
|
||||
|
|
|
@ -57,7 +57,7 @@ table_schema, table_name
|
|||
FROM information_schema.table_constraints
|
||||
WHERE constraint_catalog IS NOT NULL;
|
||||
constraint_catalog constraint_schema constraint_name table_schema table_name
|
||||
def mysql PRIMARY mysql column_stat
|
||||
def mysql PRIMARY mysql column_stats
|
||||
def mysql PRIMARY mysql columns_priv
|
||||
def mysql PRIMARY mysql db
|
||||
def mysql PRIMARY mysql event
|
||||
|
@ -70,14 +70,14 @@ def mysql PRIMARY mysql help_relation
|
|||
def mysql PRIMARY mysql help_topic
|
||||
def mysql name mysql help_topic
|
||||
def mysql PRIMARY mysql host
|
||||
def mysql PRIMARY mysql index_stat
|
||||
def mysql PRIMARY mysql index_stats
|
||||
def mysql PRIMARY mysql ndb_binlog_index
|
||||
def mysql PRIMARY mysql plugin
|
||||
def mysql PRIMARY mysql proc
|
||||
def mysql PRIMARY mysql procs_priv
|
||||
def mysql PRIMARY mysql proxies_priv
|
||||
def mysql PRIMARY mysql servers
|
||||
def mysql PRIMARY mysql table_stat
|
||||
def mysql PRIMARY mysql table_stats
|
||||
def mysql PRIMARY mysql tables_priv
|
||||
def mysql PRIMARY mysql time_zone
|
||||
def mysql PRIMARY mysql time_zone_leap_second
|
||||
|
|
|
@ -8,7 +8,7 @@ WHERE table_schema = 'mysql'
|
|||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
def mysql PRIMARY mysql columns_priv PRIMARY KEY
|
||||
def mysql PRIMARY mysql column_stat PRIMARY KEY
|
||||
def mysql PRIMARY mysql column_stats PRIMARY KEY
|
||||
def mysql PRIMARY mysql db PRIMARY KEY
|
||||
def mysql PRIMARY mysql event PRIMARY KEY
|
||||
def mysql PRIMARY mysql func PRIMARY KEY
|
||||
|
@ -20,7 +20,7 @@ def mysql PRIMARY mysql help_relation PRIMARY KEY
|
|||
def mysql name mysql help_topic UNIQUE
|
||||
def mysql PRIMARY mysql help_topic PRIMARY KEY
|
||||
def mysql PRIMARY mysql host PRIMARY KEY
|
||||
def mysql PRIMARY mysql index_stat PRIMARY KEY
|
||||
def mysql PRIMARY mysql index_stats PRIMARY KEY
|
||||
def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
|
||||
def mysql PRIMARY mysql plugin PRIMARY KEY
|
||||
def mysql PRIMARY mysql proc PRIMARY KEY
|
||||
|
@ -28,7 +28,7 @@ def mysql PRIMARY mysql procs_priv PRIMARY KEY
|
|||
def mysql PRIMARY mysql proxies_priv PRIMARY KEY
|
||||
def mysql PRIMARY mysql servers PRIMARY KEY
|
||||
def mysql PRIMARY mysql tables_priv PRIMARY KEY
|
||||
def mysql PRIMARY mysql table_stat PRIMARY KEY
|
||||
def mysql PRIMARY mysql table_stats PRIMARY KEY
|
||||
def mysql PRIMARY mysql time_zone PRIMARY KEY
|
||||
def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
|
||||
def mysql PRIMARY mysql time_zone_name PRIMARY KEY
|
||||
|
|
|
@ -37,7 +37,7 @@ user_comment Column privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME column_stat
|
||||
TABLE_NAME column_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -267,7 +267,7 @@ user_comment Host privileges; Merged with database privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME index_stat
|
||||
TABLE_NAME index_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -474,7 +474,7 @@ user_comment Table privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME table_stat
|
||||
TABLE_NAME table_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
|
|
@ -37,7 +37,7 @@ user_comment Column privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME column_stat
|
||||
TABLE_NAME column_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -267,7 +267,7 @@ user_comment Host privileges; Merged with database privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME index_stat
|
||||
TABLE_NAME index_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -474,7 +474,7 @@ user_comment Table privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME table_stat
|
||||
TABLE_NAME table_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -674,7 +674,7 @@ user_comment Column privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME column_stat
|
||||
TABLE_NAME column_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -904,7 +904,7 @@ user_comment Host privileges; Merged with database privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME index_stat
|
||||
TABLE_NAME index_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
@ -1111,7 +1111,7 @@ user_comment Table privileges
|
|||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME table_stat
|
||||
TABLE_NAME table_stats
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 10
|
||||
|
|
|
@ -23,18 +23,18 @@ set optimizer_switch='extended_keys=off';
|
|||
--disable_warnings
|
||||
--source include/dbt3_s001.inc
|
||||
create index i_p_retailprice on part(p_retailprice);
|
||||
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
|
||||
customer, lineitem, nation, orders, part, partsupp, region, supplier;
|
||||
FLUSH TABLE mysql.table_stat, mysql.index_stat;
|
||||
FLUSH TABLE mysql.table_stats, mysql.index_stats;
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
select * from mysql.table_stat;
|
||||
select * from mysql.index_stat;
|
||||
select * from mysql.table_stats;
|
||||
select * from mysql.index_stats;
|
||||
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
|
@ -57,29 +57,29 @@ eval $Q5;
|
|||
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
delete from mysql.index_stat;
|
||||
delete from mysql.index_stats;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
ANALYZE TABLE
|
||||
customer, lineitem, nation, orders, part, partsupp, region, supplier;
|
||||
FLUSH TABLE mysql.table_stat, mysql.index_stat;
|
||||
FLUSH TABLE mysql.table_stats, mysql.index_stats;
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
select * from mysql.table_stat;
|
||||
select * from mysql.index_stat;
|
||||
select * from mysql.table_stats;
|
||||
select * from mysql.index_stats;
|
||||
|
||||
select * from mysql.table_stat where table_name='orders';
|
||||
select * from mysql.index_stat where table_name='orders';
|
||||
select (select cardinality from mysql.table_stat where table_name='orders') /
|
||||
(select avg_frequency from mysql.index_stat
|
||||
select * from mysql.table_stats where table_name='orders';
|
||||
select * from mysql.index_stats where table_name='orders';
|
||||
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;
|
||||
select count(distinct o_orderdate) from orders;
|
||||
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;
|
||||
select count(distinct o_custkey) from orders;
|
||||
show index from orders;
|
||||
|
@ -191,7 +191,7 @@ FLUSH TABLE t1;
|
|||
SET use_stat_tables='never';
|
||||
EXPLAIN SELECT * FROM t1;
|
||||
|
||||
--move_file $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stat.MYD $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stat.MYD.save
|
||||
--move_file $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stats.MYD $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stats.MYD.save
|
||||
|
||||
FLUSH TABLES;
|
||||
SET use_stat_tables='preferably';
|
||||
|
@ -200,7 +200,7 @@ EXPLAIN SELECT * FROM t1;
|
|||
--enable_warnings
|
||||
|
||||
# Cleanup
|
||||
--move_file $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stat.MYD.save $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stat.MYD
|
||||
--move_file $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stats.MYD.save $MYSQLTEST_VARDIR/mysqld.1/data/mysql/table_stats.MYD
|
||||
DROP TABLE t1;
|
||||
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
|
|
@ -24,9 +24,9 @@ set optimizer_switch='extended_keys=off';
|
|||
--disable_result_log
|
||||
--disable_warnings
|
||||
--source include/dbt3_s001.inc
|
||||
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
|
||||
customer, lineitem, nation, orders, part, partsupp, region, supplier;
|
||||
--enable_warnings
|
||||
|
|
|
@ -21,17 +21,17 @@ set optimizer_switch='extended_keys=off';
|
|||
--disable_result_log
|
||||
--disable_warnings
|
||||
--source include/dbt3_s001.inc
|
||||
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
|
||||
customer, lineitem, nation, orders, part, partsupp, region, supplier;
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
select * from mysql.table_stat;
|
||||
select * from mysql.index_stat;
|
||||
select * from mysql.table_stats;
|
||||
select * from mysql.index_stats;
|
||||
|
||||
|
||||
#
|
||||
|
@ -93,20 +93,20 @@ set debug_sync='RESET';
|
|||
# DEBUG_SYNC(thd, "statistics_collection_start2");
|
||||
#
|
||||
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
delete from mysql.index_stat
|
||||
select * from mysql.index_stats where table_name='lineitem' order by index_name;
|
||||
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;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
delete from mysql.index_stat
|
||||
select * from mysql.index_stats where table_name='lineitem' order by index_name;
|
||||
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;
|
||||
|
||||
connect (con1, localhost, root,,);
|
||||
connect (con2, localhost, root,,);
|
||||
|
@ -144,7 +144,7 @@ disconnect con1;
|
|||
disconnect con2;
|
||||
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;
|
||||
|
||||
DROP DATABASE dbt3_s001;
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ 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';
|
||||
|
||||
|
@ -69,13 +69,13 @@ INSERT INTO t1 VALUES
|
|||
|
||||
ANALYZE TABLE t1;
|
||||
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
SELECT * FROM mysql.column_stat
|
||||
SELECT * FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='a';
|
||||
SELECT MIN(t1.a), MAX(t1.a),
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.b IS NULL) /
|
||||
|
@ -84,7 +84,7 @@ SELECT MIN(t1.a), MAX(t1.a),
|
|||
(SELECT COUNT(DISTINCT t1.a) FROM t1) AS "AVG_FREQUENCY(t1.a)"
|
||||
FROM t1;
|
||||
|
||||
SELECT * FROM mysql.column_stat
|
||||
SELECT * FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='b';
|
||||
SELECT MIN(t1.b), MAX(t1.b),
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.b IS NULL) /
|
||||
|
@ -93,7 +93,7 @@ SELECT MIN(t1.b), MAX(t1.b),
|
|||
(SELECT COUNT(DISTINCT t1.b) FROM t1) AS "AVG_FREQUENCY(t1.b)"
|
||||
FROM t1;
|
||||
|
||||
SELECT * FROM mysql.column_stat
|
||||
SELECT * FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='c';
|
||||
SELECT MIN(t1.c), MAX(t1.c),
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.c IS NULL) /
|
||||
|
@ -102,7 +102,7 @@ SELECT MIN(t1.c), MAX(t1.c),
|
|||
(SELECT COUNT(DISTINCT t1.c) FROM t1) AS "AVG_FREQUENCY(t1.c)"
|
||||
FROM t1;
|
||||
|
||||
SELECT * FROM mysql.column_stat
|
||||
SELECT * FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='d';
|
||||
SELECT MIN(t1.d), MAX(t1.d),
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.d IS NULL) /
|
||||
|
@ -111,7 +111,7 @@ SELECT MIN(t1.d), MAX(t1.d),
|
|||
(SELECT COUNT(DISTINCT t1.d) FROM t1) AS "AVG_FREQUENCY(t1.d)"
|
||||
FROM t1;
|
||||
|
||||
SELECT * FROM mysql.column_stat
|
||||
SELECT * FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='e';
|
||||
SELECT MIN(t1.e), MAX(t1.e),
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.e IS NULL) /
|
||||
|
@ -120,7 +120,7 @@ SELECT MIN(t1.e), MAX(t1.e),
|
|||
(SELECT COUNT(DISTINCT t1.e) FROM t1) AS "AVG_FREQUENCY(t1.e)"
|
||||
FROM t1;
|
||||
|
||||
SELECT * FROM mysql.index_stat
|
||||
SELECT * FROM mysql.index_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND index_name='idx1';
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.b IS NOT NULL) /
|
||||
|
@ -131,7 +131,7 @@ SELECT
|
|||
WHERE t1.b IS NOT NULL AND t1.e IS NOT NULL)
|
||||
AS 'ARITY 2';
|
||||
|
||||
SELECT * FROM mysql.index_stat
|
||||
SELECT * FROM mysql.index_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND index_name='idx2';
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.c IS NOT NULL) /
|
||||
|
@ -142,14 +142,14 @@ SELECT
|
|||
WHERE t1.c IS NOT NULL AND t1.d IS NOT NULL)
|
||||
AS 'ARITY 2';
|
||||
|
||||
SELECT * FROM mysql.index_stat
|
||||
SELECT * FROM mysql.index_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND index_name='idx3';
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.d IS NOT NULL) /
|
||||
(SELECT COUNT(DISTINCT t1.d) FROM t1 WHERE t1.d IS NOT NULL)
|
||||
AS 'ARITY 1';
|
||||
|
||||
SELECT * FROM mysql.index_stat
|
||||
SELECT * FROM mysql.index_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND index_name='idx4';
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM t1 WHERE t1.e IS NOT NULL) /
|
||||
|
@ -193,24 +193,24 @@ INSERT INTO t3 VALUES
|
|||
|
||||
ANALYZE TABLE t3;
|
||||
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE t1 RENAME TO s1;
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
RENAME TABLE s1 TO t1;
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
DROP TABLE t3;
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
|
||||
CREATE TEMPORARY TABLE t0 (
|
||||
|
@ -222,84 +222,84 @@ INSERT INTO t0 SELECT a,b FROM t1;
|
|||
ALTER TABLE t1 CHANGE COLUMN b x varchar(32),
|
||||
CHANGE COLUMN e y double;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
ALTER TABLE t1 CHANGE COLUMN x b varchar(32),
|
||||
CHANGE COLUMN y e double;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
ALTER TABLE t1 RENAME TO s1, CHANGE COLUMN b x varchar(32);
|
||||
SHOW CREATE TABLE s1;
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE s1 RENAME TO t1, CHANGE COLUMN x b varchar(32);
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE t1 CHANGE COLUMN b x varchar(30);
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE t1 CHANGE COLUMN x b varchar(32);
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx4);
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval
|
||||
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';
|
||||
FROM mysql.column_stats WHERE column_name='b';
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval
|
||||
SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/save_index_stat'
|
||||
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;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE t1 CHANGE COLUMN x b varchar(32);
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval
|
||||
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';
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval
|
||||
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.index_stat;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/save_column_stat;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/save_index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/save_column_stats;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/save_index_stats;
|
||||
|
||||
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
DROP INDEX idx2 ON t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
DROP INDEX idx1 ON t1;
|
||||
DROP INDEX idx4 ON t1;
|
||||
|
@ -310,63 +310,63 @@ CREATE INDEX idx1 ON t1(b, e);
|
|||
CREATE INDEX idx2 ON t1(c, d);
|
||||
CREATE INDEX idx4 ON t1(e, b, d);
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx2, idx4);
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
UPDATE t1 SET b=(SELECT b FROM t0 WHERE t0.a= t1.a);
|
||||
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx2, idx4);
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE t1 DROP COLUMN b,
|
||||
DROP INDEX idx1, DROP INDEX idx2, DROP INDEX idx4;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ALTER TABLE t1 ADD COLUMN b varchar(32);
|
||||
ALTER TABLE t1
|
||||
ADD INDEX idx1 (b, e), ADD INDEX idx2 (c, d), ADD INDEX idx4 (e, b, d);
|
||||
UPDATE t1 SET b=(SELECT b FROM t0 WHERE t0.a= t1.a);
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES(idx1, idx2, idx4);
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
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();
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(c,e,b) INDEXES(idx2,idx4);
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
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;
|
||||
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS() INDEXES(primary);
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
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;
|
||||
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
|
@ -375,14 +375,14 @@ INSERT INTO t2 SELECT * FROM t1;
|
|||
|
||||
ANALYZE TABLE t2;
|
||||
|
||||
SELECT * FROM mysql.table_stat;
|
||||
SELECT * FROM mysql.column_stat ORDER BY column_name;
|
||||
SELECT * FROM mysql.index_stat ORDER BY index_name, prefix_arity, table_name;
|
||||
SELECT * FROM mysql.table_stats;
|
||||
SELECT * FROM mysql.column_stats ORDER BY column_name;
|
||||
SELECT * FROM mysql.index_stats ORDER BY index_name, prefix_arity, table_name;
|
||||
|
||||
|
||||
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,
|
||||
|
@ -394,14 +394,14 @@ ALTER TABLE t1
|
|||
|
||||
ANALYZE TABLE t1;
|
||||
|
||||
SELECT * FROM mysql.column_stat;
|
||||
SELECT * FROM mysql.index_stat;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
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';
|
||||
|
||||
|
@ -428,13 +428,13 @@ ANALYZE TABLE Country, City, CountryLanguage;
|
|||
--enable_result_log
|
||||
|
||||
SELECT UPPER(db_name), UPPER(table_name), cardinality
|
||||
FROM mysql.table_stat;
|
||||
FROM mysql.table_stats;
|
||||
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;
|
||||
SELECT UPPER(db_name), UPPER(table_name),
|
||||
index_name, prefix_arity, avg_frequency
|
||||
FROM mysql.index_stat;
|
||||
FROM mysql.index_stats;
|
||||
|
||||
use test;
|
||||
|
||||
|
@ -465,39 +465,39 @@ ANALYZE TABLE Country, City, CountryLanguage;
|
|||
--enable_result_log
|
||||
|
||||
SELECT UPPER(db_name), UPPER(table_name), cardinality
|
||||
FROM mysql.table_stat;
|
||||
FROM mysql.table_stats;
|
||||
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;
|
||||
SELECT UPPER(db_name), UPPER(table_name),
|
||||
index_name, prefix_arity, avg_frequency
|
||||
FROM mysql.index_stat;
|
||||
FROM mysql.index_stats;
|
||||
|
||||
use test;
|
||||
|
||||
DROP DATABASE world;
|
||||
SELECT UPPER(db_name), UPPER(table_name), cardinality
|
||||
FROM mysql.table_stat;
|
||||
FROM mysql.table_stats;
|
||||
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;
|
||||
SELECT UPPER(db_name), UPPER(table_name),
|
||||
index_name, prefix_arity, avg_frequency
|
||||
FROM mysql.index_stat;
|
||||
FROM mysql.index_stats;
|
||||
|
||||
DROP DATABASE world_innodb;
|
||||
SELECT UPPER(db_name), UPPER(table_name), cardinality
|
||||
FROM mysql.table_stat;
|
||||
FROM mysql.table_stats;
|
||||
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;
|
||||
SELECT UPPER(db_name), UPPER(table_name),
|
||||
index_name, prefix_arity, avg_frequency
|
||||
FROM mysql.index_stat;
|
||||
FROM mysql.index_stats;
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ CREATE TABLE time_zone_transition_type ( Time_zone_id int unsigned NOT NULL,
|
|||
|
||||
CREATE TABLE time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
|
||||
|
||||
CREATE TABLE table_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
CREATE TABLE table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
|
||||
CREATE TABLE column_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio double DEFAULT NULL, avg_length double DEFAULT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
CREATE TABLE column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio double DEFAULT NULL, avg_length double DEFAULT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
|
||||
CREATE TABLE index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
CREATE TABLE index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
|
||||
# Run the mysql_fix_privilege_tables.sql using "mysql --force"
|
||||
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
|
||||
|
@ -77,7 +77,7 @@ CREATE TABLE index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NO
|
|||
-- disable_query_log
|
||||
|
||||
# Drop all tables created by this test
|
||||
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, table_stat, column_stat, index_stat;
|
||||
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, table_stats, column_stats, index_stats;
|
||||
|
||||
-- enable_query_log
|
||||
|
||||
|
|
|
@ -66,11 +66,11 @@ CREATE TABLE servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) N
|
|||
|
||||
INSERT INTO servers VALUES ('test','localhost','test','root','', 0,'','mysql','root');
|
||||
|
||||
CREATE TABLE table_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
CREATE TABLE table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
|
||||
CREATE TABLE column_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio double DEFAULT NULL, avg_length double DEFAULT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
CREATE TABLE column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio double DEFAULT NULL, avg_length double DEFAULT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
|
||||
CREATE TABLE index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
CREATE TABLE index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
|
||||
# Run the mysql_fix_privilege_tables.sql using "mysql --force"
|
||||
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
|
||||
|
@ -84,7 +84,7 @@ CREATE TABLE index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NO
|
|||
-- disable_query_log
|
||||
|
||||
# Drop all tables created by this test
|
||||
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, table_stat, column_stat, index_stat;
|
||||
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, table_stats, column_stats, index_stats;
|
||||
|
||||
-- enable_query_log
|
||||
|
||||
|
|
|
@ -85,11 +85,11 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b
|
|||
|
||||
CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
|
||||
|
||||
CREATE TABLE table_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
CREATE TABLE table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
|
||||
CREATE TABLE column_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio double DEFAULT NULL, avg_length double DEFAULT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
CREATE TABLE column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio double DEFAULT NULL, avg_length double DEFAULT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
|
||||
CREATE TABLE index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
CREATE TABLE index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency double DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
|
||||
# Run the mysql_fix_privilege_tables.sql using "mysql --force"
|
||||
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
|
||||
|
@ -103,7 +103,7 @@ CREATE TABLE index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NO
|
|||
-- disable_query_log
|
||||
|
||||
# Drop all tables created by this test
|
||||
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, table_stat, column_stat, index_stat;
|
||||
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, table_stats, column_stats, index_stats;
|
||||
|
||||
-- enable_query_log
|
||||
|
||||
|
|
|
@ -483,8 +483,8 @@ CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NUL
|
|||
-- Remember for later if proxies_priv table already existed
|
||||
set @had_proxies_priv_table= @@warning_count != 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS table_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
CREATE TABLE IF NOT EXISTS table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS column_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio decimal(12,4) DEFAULT NULL, avg_length decimal(12,4) DEFAULT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
CREATE TABLE IF NOT EXISTS column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio decimal(12,4) DEFAULT NULL, avg_length decimal(12,4) DEFAULT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS index_stat (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
CREATE TABLE IF NOT EXISTS index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
|
||||
|
|
|
@ -63,9 +63,9 @@ static const uint STATISTICS_TABLES= 3;
|
|||
*/
|
||||
static const LEX_STRING stat_table_name[STATISTICS_TABLES]=
|
||||
{
|
||||
{ C_STRING_WITH_LEN("table_stat") },
|
||||
{ C_STRING_WITH_LEN("column_stat") },
|
||||
{ C_STRING_WITH_LEN("index_stat") }
|
||||
{ C_STRING_WITH_LEN("table_stats") },
|
||||
{ C_STRING_WITH_LEN("column_stats") },
|
||||
{ C_STRING_WITH_LEN("index_stats") }
|
||||
};
|
||||
|
||||
/* Name of database to which the statistical tables belong */
|
||||
|
@ -191,8 +191,8 @@ public:
|
|||
as well as update access fields belonging to the primary key and
|
||||
delete records by prefixes of the primary key.
|
||||
Objects of the classes Table_stat, Column_stat and Index stat are used
|
||||
for reading/writing statistics from/into persistent tables table_stat,
|
||||
column_stat and index_stat correspondingly. These tables are stored in
|
||||
for reading/writing statistics from/into persistent tables table_stats,
|
||||
column_stats and index_stats correspondingly. These tables are stored in
|
||||
the system database 'mysql'.
|
||||
|
||||
Statistics is read and written always for a given database table t. When
|
||||
|
@ -212,10 +212,10 @@ public:
|
|||
Reading/writing statistical data from/into a statistical table is always
|
||||
performed by a key. At the moment there is only one key defined for each
|
||||
statistical table and this key is primary.
|
||||
The primary key for the table table_stat is built as (db_name, table_name).
|
||||
The primary key for the table column_stat is built as (db_name, table_name,
|
||||
The primary key for the table table_stats is built as (db_name, table_name).
|
||||
The primary key for the table column_stats is built as (db_name, table_name,
|
||||
column_name).
|
||||
The primary key for the table index_stat is built as (db_name, table_name,
|
||||
The primary key for the table index_stats is built as (db_name, table_name,
|
||||
index_name, prefix_arity).
|
||||
|
||||
Reading statistical data from a statistical table is performed by the
|
||||
|
@ -228,17 +228,17 @@ public:
|
|||
|
||||
Let's assume the statistical data is read for table t from database db.
|
||||
|
||||
When statistical data is searched in the table table_stat first
|
||||
When statistical data is searched in the table table_stats first
|
||||
Table_stat::set_key_fields() should set the fields of db_name and
|
||||
table_name. Then get_stat_values looks for a row by the set key value,
|
||||
and, if the row is found, reads the value from the column
|
||||
table_stat.cardinality into the field read_stat.cardinality of the TABLE
|
||||
table_stats.cardinality into the field read_stat.cardinality of the TABLE
|
||||
structure for table t and sets the value of read_stat.cardinality_is_null
|
||||
from this structure to FALSE. If the value of the 'cardinality' column
|
||||
in the row is null or if no row is found read_stat.cardinality_is_null
|
||||
is set to TRUE.
|
||||
|
||||
When statistical data is searched in the table column_stat first
|
||||
When statistical data is searched in the table column_stats first
|
||||
Column_stat::set_key_fields() should set the fields of db_name, table_name
|
||||
and column_name with column_name taken out of the only parameter f of the
|
||||
Field* type passed to this method. After this get_stat_values looks
|
||||
|
@ -254,14 +254,14 @@ public:
|
|||
Otherwise the flag is set on. If no row is found for the column the all flags
|
||||
in f->column_stat_nulls are set off.
|
||||
|
||||
When statistical data is searched in the table index_stat first
|
||||
When statistical data is searched in the table index_stats first
|
||||
Index_stat::set_key_fields() has to be called to set the fields of db_name,
|
||||
table_name, index_name and prefix_arity. The value of index_name is extracted
|
||||
from the first parameter key_info of the KEY* type passed to the method.
|
||||
This parameter specifies the index of interest idx. The second parameter
|
||||
passed to the method specifies the arity k of the index prefix for which
|
||||
statistical data is to be read. E.g. if the index idx consists of 3
|
||||
components (p1,p2,p3) the table index_stat usually will contain 3 rows for
|
||||
components (p1,p2,p3) the table index_stats usually will contain 3 rows for
|
||||
this index: the first - for the prefix (p1), the second - for the prefix
|
||||
(p1,p2), and the third - for the the prefix (p1,p2,p3). After the key fields
|
||||
has been set a call of get_stat_value looks for a row by the set key value.
|
||||
|
@ -582,8 +582,8 @@ public:
|
|||
|
||||
/*
|
||||
An object of the class Table_stat is created to read statistical
|
||||
data on tables from the statistical table table_stat, to update
|
||||
table_stat with such statistical data, or to update columns
|
||||
data on tables from the statistical table table_stats, to update
|
||||
table_stats with such statistical data, or to update columns
|
||||
of the primary key, or to delete the record by its primary key or
|
||||
its prefix.
|
||||
Rows from the statistical table are read and updated always by
|
||||
|
@ -595,8 +595,8 @@ class Table_stat: public Stat_table
|
|||
|
||||
private:
|
||||
|
||||
Field *db_name_field; /* Field for the column table_stat.db_name */
|
||||
Field *table_name_field; /* Field for the column table_stat.table_name */
|
||||
Field *db_name_field; /* Field for the column table_stats.db_name */
|
||||
Field *table_name_field; /* Field for the column table_stats.table_name */
|
||||
|
||||
void common_init_table_stat()
|
||||
{
|
||||
|
@ -615,7 +615,7 @@ public:
|
|||
/**
|
||||
@details
|
||||
The constructor 'tunes' the private and protected members of the
|
||||
constructed object for the statistical table table_stat to read/update
|
||||
constructed object for the statistical table table_stats to read/update
|
||||
statistics on table 'tab'. The TABLE structure for the table table_stat
|
||||
must be passed as a value for the parameter 'stat'.
|
||||
*/
|
||||
|
@ -721,8 +721,8 @@ public:
|
|||
|
||||
/*
|
||||
An object of the class Column_stat is created to read statistical data
|
||||
on table columns from the statistical table column_stat, to update
|
||||
column_stat with such statistical data, or to update columns
|
||||
on table columns from the statistical table column_stats, to update
|
||||
column_stats with such statistical data, or to update columns
|
||||
of the primary key, or to delete the record by its primary key or
|
||||
its prefix.
|
||||
Rows from the statistical table are read and updated always by
|
||||
|
@ -734,9 +734,9 @@ class Column_stat: public Stat_table
|
|||
|
||||
private:
|
||||
|
||||
Field *db_name_field; /* Field for the column column_stat.db_name */
|
||||
Field *table_name_field; /* Field for the column column_stat.table_name */
|
||||
Field *column_name_field; /* Field for the column column_stat.column_name */
|
||||
Field *db_name_field; /* Field for the column column_stats.db_name */
|
||||
Field *table_name_field; /* Field for the column column_stats.table_name */
|
||||
Field *column_name_field; /* Field for the column column_stats.column_name */
|
||||
|
||||
Field *table_field; /* Field from 'table' to read /update statistics on */
|
||||
|
||||
|
@ -758,9 +758,9 @@ public:
|
|||
/**
|
||||
@details
|
||||
The constructor 'tunes' the private and protected members of the
|
||||
constructed object for the statistical table column_stat to read/update
|
||||
constructed object for the statistical table column_stats to read/update
|
||||
statistics on fields of the table 'tab'. The TABLE structure for the table
|
||||
column_stat must be passed as a value for the parameter 'stat'.
|
||||
column_stats must be passed as a value for the parameter 'stat'.
|
||||
*/
|
||||
|
||||
Column_stat(TABLE *stat, TABLE *tab) :Stat_table(stat, tab)
|
||||
|
@ -772,7 +772,7 @@ public:
|
|||
/**
|
||||
@details
|
||||
The constructor 'tunes' the private and protected members of the
|
||||
object constructed for the statistical table column_stat for
|
||||
object constructed for the statistical table column_stats for
|
||||
the future updates/deletes of the record concerning the table 'tab'
|
||||
from the database 'db'.
|
||||
*/
|
||||
|
@ -785,11 +785,11 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Set table name fields for the statistical table column_stat
|
||||
Set table name fields for the statistical table column_stats
|
||||
|
||||
@details
|
||||
The function stores the values of the fields db_name and table_name
|
||||
of the statistical table column_stat in the record buffer.
|
||||
of the statistical table column_stats in the record buffer.
|
||||
*/
|
||||
|
||||
void set_full_table_name()
|
||||
|
@ -802,14 +802,14 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Set the key fields for the statistical table column_stat
|
||||
Set the key fields for the statistical table column_stats
|
||||
|
||||
@param
|
||||
col Field for the 'table' column to read/update statistics on
|
||||
|
||||
@details
|
||||
The function stores the values of the fields db_name, table_name and
|
||||
column_name in the record buffer for the statistical table column_stat.
|
||||
column_name in the record buffer for the statistical table column_stats.
|
||||
These fields comprise the primary key for the table.
|
||||
It also sets table_field to the passed parameter.
|
||||
|
||||
|
@ -835,7 +835,7 @@ public:
|
|||
@details
|
||||
The function updates the primary key fields containing database name,
|
||||
table name, and column name for the last found record in the statistical
|
||||
table column_stat.
|
||||
table column_stats.
|
||||
|
||||
@retval
|
||||
FALSE success with the update of the record
|
||||
|
@ -856,7 +856,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Store statistical data into statistical fields of column_stat
|
||||
Store statistical data into statistical fields of column_stats
|
||||
|
||||
@details
|
||||
This implementation of a purely virtual method sets the value of the
|
||||
|
@ -925,11 +925,11 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Read statistical data from statistical fields of column_stat
|
||||
Read statistical data from statistical fields of column_stats
|
||||
|
||||
@details
|
||||
This implementation of a purely virtual method first looks for a record
|
||||
the statistical table column_stat by its primary key set the record
|
||||
the statistical table column_stats by its primary key set the record
|
||||
buffer with the help of Column_stat::set_key_fields. Then, if the row is
|
||||
found, the function reads the values of the columns 'min_value',
|
||||
'max_value', 'nulls_ratio', 'avg_length' and 'avg_frequency' of the
|
||||
|
@ -998,7 +998,7 @@ public:
|
|||
/*
|
||||
An object of the class Index_stat is created to read statistical
|
||||
data on tables from the statistical table table_stat, to update
|
||||
index_stat with such statistical data, or to update columns
|
||||
index_stats with such statistical data, or to update columns
|
||||
of the primary key, or to delete the record by its primary key or
|
||||
its prefix.
|
||||
Rows from the statistical table are read and updated always by
|
||||
|
@ -1010,10 +1010,10 @@ class Index_stat: public Stat_table
|
|||
|
||||
private:
|
||||
|
||||
Field *db_name_field; /* Field for the column index_stat.db_name */
|
||||
Field *table_name_field; /* Field for the column index_stat.table_name */
|
||||
Field *index_name_field; /* Field for the column index_stat.table_name */
|
||||
Field *prefix_arity_field; /* Field for the column index_stat.prefix_arity */
|
||||
Field *db_name_field; /* Field for the column index_stats.db_name */
|
||||
Field *table_name_field; /* Field for the column index_stats.table_name */
|
||||
Field *index_name_field; /* Field for the column index_stats.table_name */
|
||||
Field *prefix_arity_field; /* Field for the column index_stats.prefix_arity */
|
||||
|
||||
KEY *table_key_info; /* Info on the index to read/update statistics on */
|
||||
uint prefix_arity; /* Number of components of the index prefix of interest */
|
||||
|
@ -1038,9 +1038,9 @@ public:
|
|||
/**
|
||||
@details
|
||||
The constructor 'tunes' the private and protected members of the
|
||||
constructed object for the statistical table index_stat to read/update
|
||||
constructed object for the statistical table index_stats to read/update
|
||||
statistics on prefixes of different indexes of the table 'tab'.
|
||||
The TABLE structure for the table index_stat must be passed as a value
|
||||
The TABLE structure for the table index_stats must be passed as a value
|
||||
for the parameter 'stat'.
|
||||
*/
|
||||
|
||||
|
@ -1053,7 +1053,7 @@ public:
|
|||
/**
|
||||
@details
|
||||
The constructor 'tunes' the private and protected members of the
|
||||
object constructed for the statistical table index_stat for
|
||||
object constructed for the statistical table index_stats for
|
||||
the future updates/deletes of the record concerning the table 'tab'
|
||||
from the database 'db'.
|
||||
*/
|
||||
|
@ -1067,11 +1067,11 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Set table name fields for the statistical table index_stat
|
||||
Set table name fields for the statistical table index_stats
|
||||
|
||||
@details
|
||||
The function stores the values of the fields db_name and table_name
|
||||
of the statistical table index_stat in the record buffer.
|
||||
of the statistical table index_stats in the record buffer.
|
||||
*/
|
||||
|
||||
void set_full_table_name()
|
||||
|
@ -1083,14 +1083,14 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Set the key fields of index_stat used to access records for index prefixes
|
||||
Set the key fields of index_stats used to access records for index prefixes
|
||||
|
||||
@param
|
||||
index_info Info for the index of 'table' to read/update statistics on
|
||||
|
||||
@details
|
||||
The function sets the values of the fields db_name, table_name and
|
||||
index_name in the record buffer for the statistical table index_stat.
|
||||
index_name in the record buffer for the statistical table index_stats.
|
||||
It also sets table_key_info to the passed parameter.
|
||||
|
||||
@note
|
||||
|
@ -1110,7 +1110,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Set the key fields for the statistical table index_stat
|
||||
Set the key fields for the statistical table index_stats
|
||||
|
||||
@param
|
||||
index_info Info for the index of 'table' to read/update statistics on
|
||||
|
@ -1120,7 +1120,7 @@ public:
|
|||
@details
|
||||
The function sets the values of the fields db_name, table_name and
|
||||
index_name, prefix_arity in the record buffer for the statistical
|
||||
table index_stat. These fields comprise the primary key for the table.
|
||||
table index_stats. These fields comprise the primary key for the table.
|
||||
|
||||
@note
|
||||
The function is supposed to be called before any use of the
|
||||
|
@ -1137,11 +1137,11 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Store statistical data into statistical fields of table index_stat
|
||||
Store statistical data into statistical fields of table index_stats
|
||||
|
||||
@details
|
||||
This implementation of a purely virtual method sets the value of the
|
||||
column 'avg_frequency' of the statistical table index_stat according to
|
||||
column 'avg_frequency' of the statistical table index_stats according to
|
||||
the value of write_stat.avg_frequency[Index_stat::prefix_arity]
|
||||
from the KEY_INFO structure 'table_key_info'.
|
||||
If the value of write_stat. avg_frequency[Index_stat::prefix_arity] is
|
||||
|
@ -1165,11 +1165,11 @@ public:
|
|||
|
||||
/**
|
||||
@brief
|
||||
Read statistical data from statistical fields of index_stat
|
||||
Read statistical data from statistical fields of index_stats
|
||||
|
||||
@details
|
||||
This implementation of a purely virtual method first looks for a record the
|
||||
statistical table index_stat by its primary key set the record buffer with
|
||||
statistical table index_stats by its primary key set the record buffer with
|
||||
the help of Index_stat::set_key_fields. If the row is found the function
|
||||
reads the value of the column 'avg_freguency' of the table index_stat and
|
||||
sets the value of read_stat.avg_frequency[Index_stat::prefix_arity]
|
||||
|
@ -1200,7 +1200,7 @@ public:
|
|||
Unique class for this purpose.
|
||||
The class Count_distinct_field is used only by the function
|
||||
collect_statistics_from_table to calculate the values for
|
||||
column avg_frequency of the statistical table column_stat.
|
||||
column avg_frequency of the statistical table column_stats.
|
||||
*/
|
||||
|
||||
class Count_distinct_field: public Sql_alloc
|
||||
|
@ -1316,9 +1316,9 @@ public:
|
|||
|
||||
/*
|
||||
The class Index_prefix_calc is a helper class used to calculate the values
|
||||
for the column 'avg_frequency' of the statistical table index_stat.
|
||||
for the column 'avg_frequency' of the statistical table index_stats.
|
||||
For any table t from the database db and any k-component prefix of the
|
||||
index i for this table the row from index_stat with the primary key
|
||||
index i for this table the row from index_stats with the primary key
|
||||
(db,t,i,k) must contain in the column 'avg_frequency' either NULL or
|
||||
the number that is the ratio of N and V, where N is the number of index
|
||||
entries without NULL values in the first k components of the index i,
|
||||
|
@ -1693,8 +1693,8 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
|
|||
@note
|
||||
The function allocates the memory for the statistical data on a table in the
|
||||
table's share memory with the intention to read the statistics there from
|
||||
the system persistent statistical tables mysql.table_stat, mysql.column_stat,
|
||||
mysql.index_stat. The memory is allocated for the statistics on the table,
|
||||
the system persistent statistical tables mysql.table_stat, mysql.column_stats,
|
||||
mysql.index_stats. The memory is allocated for the statistics on the table,
|
||||
on the tables's columns, and on the table's indexes. The memory is allocated
|
||||
in the table_share's mem_root.
|
||||
If the parameter is_safe is TRUE then it is guaranteed that at any given time
|
||||
|
@ -2009,7 +2009,7 @@ int collect_statistics_for_index(THD *thd, TABLE *table, uint index)
|
|||
|
||||
@note
|
||||
The function first collects statistical data for statistical characteristics
|
||||
to be saved in the statistical tables table_stat and column_stat. To do this
|
||||
to be saved in the statistical tables table_stat and column_stats. To do this
|
||||
it performs a full table scan of 'table'. At this scan the function collects
|
||||
statistics on each column of the table and count the total number of the
|
||||
scanned rows. To calculate the value of 'avg_frequency' for a column the
|
||||
|
@ -2191,7 +2191,7 @@ int update_statistics_for_table(THD *thd, TABLE *table)
|
|||
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
|
||||
thd->clear_current_stmt_binlog_format_row();
|
||||
|
||||
/* Update the statistical table table_stat */
|
||||
/* Update the statistical table table_stats */
|
||||
stat_table= tables[TABLE_STAT].table;
|
||||
Table_stat table_stat(stat_table, table);
|
||||
restore_record(stat_table, s->default_values);
|
||||
|
@ -2200,7 +2200,7 @@ int update_statistics_for_table(THD *thd, TABLE *table)
|
|||
if (err)
|
||||
rc= 1;
|
||||
|
||||
/* Update the statistical table colum_stat */
|
||||
/* Update the statistical table colum_stats */
|
||||
stat_table= tables[COLUMN_STAT].table;
|
||||
Column_stat column_stat(stat_table, table);
|
||||
for (Field **field_ptr= table->field; *field_ptr; field_ptr++)
|
||||
|
@ -2215,7 +2215,7 @@ int update_statistics_for_table(THD *thd, TABLE *table)
|
|||
rc= 1;
|
||||
}
|
||||
|
||||
/* Update the statistical table index_stat */
|
||||
/* Update the statistical table index_stats */
|
||||
stat_table= tables[INDEX_STAT].table;
|
||||
uint key;
|
||||
key_map::Iterator it(table->keys_in_use_for_query);
|
||||
|
@ -2289,13 +2289,13 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
|
|||
|
||||
DBUG_ENTER("read_statistics_for_table");
|
||||
|
||||
/* Read statistics from the statistical table table_stat */
|
||||
/* Read statistics from the statistical table table_stats */
|
||||
stat_table= stat_tables[TABLE_STAT].table;
|
||||
Table_stat table_stat(stat_table, table);
|
||||
table_stat.set_key_fields();
|
||||
table_stat.get_stat_values();
|
||||
|
||||
/* Read statistics from the statistical table column_stat */
|
||||
/* Read statistics from the statistical table column_stats */
|
||||
stat_table= stat_tables[COLUMN_STAT].table;
|
||||
Column_stat column_stat(stat_table, table);
|
||||
for (field_ptr= table_share->field; *field_ptr; field_ptr++)
|
||||
|
@ -2305,7 +2305,7 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
|
|||
column_stat.get_stat_values();
|
||||
}
|
||||
|
||||
/* Read statistics from the statistical table index_stat */
|
||||
/* Read statistics from the statistical table index_stats */
|
||||
stat_table= stat_tables[INDEX_STAT].table;
|
||||
Index_stat index_stat(stat_table, table);
|
||||
for (key_info= table_share->key_info,
|
||||
|
@ -2503,7 +2503,7 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables)
|
|||
|
||||
@details
|
||||
The function delete statistics on the table called 'tab' of the database
|
||||
'db' from all statistical tables: table_stat, column_stat, index_stat.
|
||||
'db' from all statistical tables: table_stats, column_stats, index_stats.
|
||||
|
||||
@retval
|
||||
0 If all deletions are successful
|
||||
|
@ -2539,7 +2539,7 @@ int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab)
|
|||
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
|
||||
thd->clear_current_stmt_binlog_format_row();
|
||||
|
||||
/* Delete statistics on table from the statistical table index_stat */
|
||||
/* Delete statistics on table from the statistical table index_stats */
|
||||
stat_table= tables[INDEX_STAT].table;
|
||||
Index_stat index_stat(stat_table, db, tab);
|
||||
index_stat.set_full_table_name();
|
||||
|
@ -2550,7 +2550,7 @@ int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab)
|
|||
rc= 1;
|
||||
}
|
||||
|
||||
/* Delete statistics on table from the statistical table column_stat */
|
||||
/* Delete statistics on table from the statistical table column_stats */
|
||||
stat_table= tables[COLUMN_STAT].table;
|
||||
Column_stat column_stat(stat_table, db, tab);
|
||||
column_stat.set_full_table_name();
|
||||
|
@ -2561,7 +2561,7 @@ int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab)
|
|||
rc= 1;
|
||||
}
|
||||
|
||||
/* Delete statistics on table from the statistical table table_stat */
|
||||
/* Delete statistics on table from the statistical table table_stats */
|
||||
stat_table= tables[TABLE_STAT].table;
|
||||
Table_stat table_stat(stat_table, db, tab);
|
||||
table_stat.set_key_fields();
|
||||
|
@ -2594,7 +2594,7 @@ int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab)
|
|||
|
||||
@details
|
||||
The function delete statistics on the column 'col' belonging to the table
|
||||
'tab' from the statistical table column_stat.
|
||||
'tab' from the statistical table column_stats.
|
||||
|
||||
@retval
|
||||
0 If the deletion is successful
|
||||
|
@ -2663,7 +2663,7 @@ int delete_statistics_for_column(THD *thd, TABLE *tab, Field *col)
|
|||
|
||||
@details
|
||||
The function delete statistics on the index specified by 'key_info'
|
||||
defined on the table 'tab' from the statistical table index_stat.
|
||||
defined on the table 'tab' from the statistical table index_stats.
|
||||
|
||||
@retval
|
||||
0 If the deletion is successful
|
||||
|
@ -2734,8 +2734,8 @@ int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info)
|
|||
|
||||
@details
|
||||
The function replaces the name of the table 'tab' from the database 'db'
|
||||
for 'new_tab' in all all statistical tables: table_stat, column_stat,
|
||||
index_stat.
|
||||
for 'new_tab' in all all statistical tables: table_stats, column_stats,
|
||||
index_stats.
|
||||
|
||||
@retval
|
||||
0 If all updates of the table name are successful
|
||||
|
@ -2772,7 +2772,7 @@ int rename_table_in_stat_tables(THD *thd, LEX_STRING *db, LEX_STRING *tab,
|
|||
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
|
||||
thd->clear_current_stmt_binlog_format_row();
|
||||
|
||||
/* Rename table in the statistical table index_stat */
|
||||
/* Rename table in the statistical table index_stats */
|
||||
stat_table= tables[INDEX_STAT].table;
|
||||
Index_stat index_stat(stat_table, db, tab);
|
||||
index_stat.set_full_table_name();
|
||||
|
@ -2784,7 +2784,7 @@ int rename_table_in_stat_tables(THD *thd, LEX_STRING *db, LEX_STRING *tab,
|
|||
index_stat.set_full_table_name();
|
||||
}
|
||||
|
||||
/* Rename table in the statistical table column_stat */
|
||||
/* Rename table in the statistical table column_stats */
|
||||
stat_table= tables[COLUMN_STAT].table;
|
||||
Column_stat column_stat(stat_table, db, tab);
|
||||
column_stat.set_full_table_name();
|
||||
|
@ -2796,7 +2796,7 @@ int rename_table_in_stat_tables(THD *thd, LEX_STRING *db, LEX_STRING *tab,
|
|||
column_stat.set_full_table_name();
|
||||
}
|
||||
|
||||
/* Rename table in the statistical table table_stat */
|
||||
/* Rename table in the statistical table table_stats */
|
||||
stat_table= tables[TABLE_STAT].table;
|
||||
Table_stat table_stat(stat_table, db, tab);
|
||||
table_stat.set_key_fields();
|
||||
|
@ -2818,7 +2818,7 @@ int rename_table_in_stat_tables(THD *thd, LEX_STRING *db, LEX_STRING *tab,
|
|||
|
||||
/**
|
||||
@brief
|
||||
Rename a column in the statistical table column_stat
|
||||
Rename a column in the statistical table column_stats
|
||||
|
||||
@param
|
||||
thd The thread handle
|
||||
|
@ -2831,7 +2831,7 @@ int rename_table_in_stat_tables(THD *thd, LEX_STRING *db, LEX_STRING *tab,
|
|||
|
||||
@details
|
||||
The function replaces the name of the column 'col' belonging to the table
|
||||
'tab' for 'new_name' in the statistical table column_stat..
|
||||
'tab' for 'new_name' in the statistical table column_stats.
|
||||
|
||||
@retval
|
||||
0 If all updates of the table name are successful
|
||||
|
|
|
@ -546,10 +546,11 @@ inline bool is_system_table_name(const char *name, uint length)
|
|||
my_tolower(ci, name[3]) == 'e') ||
|
||||
|
||||
/* one of mysql.*_stat tables */
|
||||
(my_tolower(ci, name[length-4]) == 's' &&
|
||||
my_tolower(ci, name[length-3]) == 't' &&
|
||||
my_tolower(ci, name[length-2]) == 'a' &&
|
||||
my_tolower(ci, name[length-1]) == 't') ||
|
||||
(my_tolower(ci, name[length-5]) == 's' &&
|
||||
my_tolower(ci, name[length-4]) == 't' &&
|
||||
my_tolower(ci, name[length-3]) == 'a' &&
|
||||
my_tolower(ci, name[length-2]) == 't' &&
|
||||
my_tolower(ci, name[length-1]) == 's') ||
|
||||
|
||||
/* mysql.event table */
|
||||
(my_tolower(ci, name[0]) == 'e' &&
|
||||
|
|
Loading…
Add table
Reference in a new issue