33 lines
1021 B
Plaintext
33 lines
1021 B
Plaintext
drop table if exists t;
|
|
create table t (c1 varchar(20), c2 varchar(20));
|
|
insert into t values("1","1"),("2","2"),("3","3"),("4","4");
|
|
insert into t select * from t;
|
|
insert into t select * from t;
|
|
analyze table t all columns with 2 topn;
|
|
set @a = (select tidb_table_id from information_schema.tables where table_name = "t" and table_schema = "executor__kv");
|
|
select modify_count, count from mysql.stats_meta where table_id = @a;
|
|
modify_count count
|
|
0 16
|
|
select hist_id from mysql.stats_histograms where table_id = @a;
|
|
hist_id
|
|
1
|
|
2
|
|
select count(*)>0 from mysql.stats_buckets where table_id = @a;
|
|
count(*)>0
|
|
1
|
|
select count(*)>0 from mysql.stats_top_n where table_id = @a;
|
|
count(*)>0
|
|
1
|
|
drop stats t;
|
|
select modify_count, count from mysql.stats_meta where table_id = @a;
|
|
modify_count count
|
|
0 16
|
|
select hist_id from mysql.stats_histograms where table_id = @a;
|
|
hist_id
|
|
1
|
|
2
|
|
select hist_id, bucket_id from mysql.stats_buckets where table_id = @a;
|
|
hist_id bucket_id
|
|
select hist_id from mysql.stats_top_n where table_id = @a;
|
|
hist_id
|