polardbxengine/mysql-test/suite/xengine/t/cardinality.test

44 lines
1.1 KiB
Plaintext

--source suite/xengine/include/have_xengine.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1(
id bigint not null primary key,
i1 bigint, #unique
i2 bigint, #repeating
c1 varchar(20), #unique
c2 varchar(20), #repeating
index t1_1(id, i1),
index t1_2(i1, i2),
index t1_3(i2, i1),
index t1_4(c1, c2),
index t1_5(c2, c1)
) engine=xengine;
--disable_query_log
let $i=0;
while ($i<100)
{
inc $i;
eval insert t1(id, i1, i2, c1, c2) values($i, $i, $i div 10, $i, $i div 10);
}
--enable_query_log
# Flush memtable out to SST and display index cardinalities
optimize table t1;
sleep 10;
show index in t1;
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();
--echo restarting...
--source include/restart_mysqld.inc
# display index cardinalities after the restart
show index in t1;
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();
drop table t1;
--source suite/xengine/include/check_xengine_log_error.inc