summaryrefslogtreecommitdiff
path: root/mysql-test/r/statistics.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-12-05 22:51:11 -0800
committerIgor Babaev <igor@askmonty.org>2012-12-05 22:51:11 -0800
commitdd119466c35d621d191d4d4ddcb578cb02420bdc (patch)
tree518ab13e2d7a160c82745c348f27c4b1253f8ee7 /mysql-test/r/statistics.result
parent81563081e5fb6f016d5be845af55234869a5fb61 (diff)
downloadmariadb-git-dd119466c35d621d191d4d4ddcb578cb02420bdc.tar.gz
Addressed the following issues from the review of the patch:
1. The PERSISTENT FOR clause of the ANALYZE command overrides the setting of the system variable use_stat_tables: with this clause ANALYZE unconditionally collects persistent statistics. 2. ANALYZE collects persistent statistics only for tables of the USER category. So it never collects persistent statistics for system tables.
Diffstat (limited to 'mysql-test/r/statistics.result')
-rw-r--r--mysql-test/r/statistics.result64
1 files changed, 63 insertions, 1 deletions
diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result
index ecb252d4c01..e3f4d6bf564 100644
--- a/mysql-test/r/statistics.result
+++ b/mysql-test/r/statistics.result
@@ -1016,11 +1016,73 @@ test t1 idx1 2 NULL
test t1 idx4 1 6.2000
test t1 idx4 2 NULL
test t1 idx4 3 NULL
-DROP TABLE t1,t2;
DELETE FROM mysql.table_stats;
DELETE FROM mysql.column_stats;
DELETE FROM mysql.index_stats;
+ANALYZE TABLE mysql.column_stats PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+mysql.column_stats analyze error Invalid argument
+ANALYZE TABLE mysql.column_stats;
+Table Op Msg_type Msg_text
+mysql.column_stats analyze status OK
+SELECT * FROM mysql.table_stats;
+db_name table_name cardinality
+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_stats;
+db_name table_name index_name prefix_arity avg_frequency
set use_stat_tables='never';
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+SELECT * FROM mysql.table_stats;
+db_name table_name cardinality
+test t1 40
+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
+test t1 b NULL NULL 0.2000 17.1250 NULL
+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
+test t1 idx2 1 7.0000
+test t1 idx2 2 2.3846
+test t1 idx1 1 NULL
+test t1 idx1 2 NULL
+test t1 idx4 1 6.2000
+test t1 idx4 2 NULL
+test t1 idx4 3 NULL
+SELECT * FROM mysql.table_stats;
+db_name table_name cardinality
+test t1 40
+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
+test t1 b NULL NULL 0.2000 17.1250 NULL
+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
+test t1 idx2 1 7.0000
+test t1 idx2 2 2.3846
+test t1 idx1 1 NULL
+test t1 idx1 2 NULL
+test t1 idx4 1 6.2000
+test t1 idx4 2 NULL
+test t1 idx4 3 NULL
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
+DROP TABLE t1,t2;
set names utf8;
CREATE DATABASE world;
use world;