75 lines
1.4 KiB
Plaintext
75 lines
1.4 KiB
Plaintext
--source suite/xengine/include/have_xengine.inc
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
##
|
|
## https://work.aone.alibaba-inc.com/issue/21816959
|
|
##
|
|
##
|
|
|
|
|
|
create table t1(
|
|
id int(11) NOT NULL,
|
|
c1 int(11) DEFAULT NULL,
|
|
c2 int(11) DEFAULT NULL,
|
|
PRIMARY KEY(id),
|
|
KEY idx_c1c2(c1, c2)
|
|
)ENGINE=XENGINE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
|
|
--disable_warnings
|
|
drop procedure if exists insert_data;
|
|
--enable_warnings
|
|
|
|
delimiter //;
|
|
|
|
CREATE PROCEDURE insert_data(start int, end int)
|
|
BEGIN
|
|
DECLARE i int DEFAULT 0;
|
|
DECLARE a int DEFAULT 0;
|
|
DECLARE b int DEFAULT 0;
|
|
|
|
set i=start;
|
|
WHILE i<end
|
|
DO
|
|
SELECT FLOOR(RAND()*(1000000-0+1)+0) into a;
|
|
SELECT FLOOR(RAND()*(1000000-0+1)+0) into b;
|
|
INSERT INTO t1(id,c1,c2) VALUES(i,a,b);
|
|
set i=i+1;
|
|
END WHILE;
|
|
|
|
END//
|
|
delimiter ;//
|
|
|
|
call insert_data(0,5000);
|
|
analyze table t1;
|
|
call insert_data(5000,10000);
|
|
analyze table t1;
|
|
call insert_data(10000,15000);
|
|
analyze table t1;
|
|
call insert_data(15000,20000);
|
|
analyze table t1;
|
|
#call insert_data(30000,40000);
|
|
#analyze table t1;
|
|
#call insert_data(40000,50000);
|
|
#analyze table t1;
|
|
#call insert_data(50000,60000);
|
|
#analyze table t1;
|
|
|
|
select count(*) from t1;
|
|
|
|
--disable_warnings
|
|
alter table t1 add index idx_c1_c2(c1,c2);
|
|
--enable_warnings
|
|
|
|
show create table t1;
|
|
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
drop procedure if exists insert_data;
|
|
--source suite/xengine/include/check_xengine_log_error.inc
|