2001-09-28 07:05:54 +02:00
|
|
|
drop table if exists t1,t2;
|
|
|
|
create table t1 (i int, j int);
|
|
|
|
insert into t1 values (1,2), (3,4), (5,6), (7,8);
|
2003-01-10 16:36:59 +01:00
|
|
|
select count(*) from t1 procedure analyse();
|
|
|
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
2003-01-27 15:37:05 +01:00
|
|
|
count(*) 4 4 1 1 0 0 4.0000 0.0000 ENUM('4') NOT NULL
|
2001-09-28 07:05:54 +02:00
|
|
|
select * from t1 procedure analyse();
|
2000-12-28 02:56:38 +01:00
|
|
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
|
|
|
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
|
|
|
|
t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL
|
2001-09-28 07:05:54 +02:00
|
|
|
create table t2 select * from t1 procedure analyse();
|
|
|
|
select * from t2;
|
2000-12-28 02:56:38 +01:00
|
|
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
|
|
|
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
|
|
|
|
t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL
|
2001-09-28 07:05:54 +02:00
|
|
|
drop table t1,t2;
|
2002-12-05 20:51:22 +01:00
|
|
|
EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE();
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
2002-12-15 09:23:55 +01:00
|
|
|
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
|