create table t1 (a bigint); lock tables t1 write; insert into t1 values(0); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK unlock tables; check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; create table t1 (a bigint); insert into t1 values(0); lock tables t1 write; delete from t1; analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK unlock tables; check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; create table t1 (a bigint); insert into t1 values(0); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; insert into t1 values ('hello'); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze Warning Engine-independent statistics are not collected for column 'a' test.t1 analyze status OK analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze Warning Engine-independent statistics are not collected for column 'a' test.t1 analyze status Table is already up to date drop table t1; CREATE TABLE t1 (a int); prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; execute stmt1; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype execute stmt1; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype deallocate prepare stmt1; drop table t1; create temporary table t1(a int, index(a)); insert into t1 values('1'),('2'),('3'),('4'),('5'); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored t1 1 a 1 a A 5 NULL NULL YES BTREE NO drop table t1; End of 4.1 tests create table t1(a int); analyze table t1 extended; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 optimize table t1 extended; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 drop table t1; End of 5.0 tests # # Test analyze of text column (not yet supported) # set optimizer_use_condition_selectivity=4; set histogram_type='single_prec_hb'; set histogram_size=255; create table t1 (a int not null, t tinytext, tx text); insert into t1 select seq+1, repeat('X',seq*5), repeat('X',seq*10) from seq_0_to_50; insert into t1 select seq+100, repeat('X',5), "" from seq_1_to_10; analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze Warning Engine-independent statistics are not collected for column 't' test.t1 analyze Warning Engine-independent statistics are not collected for column 'tx' test.t1 analyze status OK explain select count(*) from t1 where t='XXXXXX'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 61 Using where select column_name, min_value, max_value, hist_size from mysql.column_stats where table_name='t1'; column_name min_value max_value hist_size a 1 110 255 drop table t1; set use_stat_tables=default; set histogram_type=default; set histogram_size=default; # # End of 10.6 tests #