1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed the bug that caused displaying incorrect values in

the column cardinality of the table information_schema.statistics.
This commit is contained in:
Igor Babaev
2012-05-17 16:54:26 -07:00
parent 2a1afc29f2
commit 9b79feba56
5 changed files with 92 additions and 2 deletions

View File

@@ -69,6 +69,20 @@ FLUSH TABLE mysql.table_stat, mysql.index_stat;
select * from mysql.table_stat;
select * from mysql.index_stat;
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
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
where index_name='i_o_custkey' and prefix_arity=1) as n_distinct;
select count(distinct o_custkey) from orders;
show index from orders;
select index_name, column_name, cardinality from information_schema.statistics
where table_name='orders';
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='index_condition_pushdown=off';