mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 07:14:17 +01:00
b9acf365e3
git-svn-id: file:///svn/mysql/tests/mysql-test@53944 c7de825b-a66e-492c-adef-691d508d4ae1
45 lines
915 B
Text
45 lines
915 B
Text
source include/have_tokudb.inc;
|
|
|
|
disable_warnings;
|
|
drop table if exists tt;
|
|
enable_warnings;
|
|
|
|
create table tt (a int, b int, primary key(a), key(b));
|
|
let $i=0;
|
|
while ($i < 1000) {
|
|
let $a=4*$i;
|
|
eval insert into tt values ($a,$a+1),($a+1,$a+2),($a+2,$a+3),($a+3,$a+4);
|
|
inc $i;
|
|
}
|
|
|
|
# test that analyze computes the correct cardinality for the keys
|
|
show indexes from tt;
|
|
analyze table tt;
|
|
show indexes from tt;
|
|
|
|
# test that cardinality is persistent
|
|
flush tables;
|
|
show indexes from tt;
|
|
|
|
drop table tt;
|
|
|
|
create table tt (a int, b int, primary key(a), key(b));
|
|
let $i=0;
|
|
while ($i < 1000) {
|
|
let $a=4*$i;
|
|
eval insert into tt values ($a,0),($a+1,0),($a+2,0),($a+3,0);
|
|
inc $i;
|
|
}
|
|
|
|
# test that analyze computes the correct cardinality for the keys
|
|
show indexes from tt;
|
|
analyze table tt;
|
|
show indexes from tt;
|
|
|
|
# test that cardinality is persistent
|
|
flush tables;
|
|
show indexes from tt;
|
|
|
|
drop table tt;
|
|
|
|
|