复制代码 代码如下:
create table t_user(
id int primary key auto_increment,
email varchar(255),
password varchar(255)
);
复制代码 代码如下:
BEGIN
DECLARE i INT;
START TRANSACTION;
SET i=0;
WHILE i<1000000 DO
INSERT INTO t_user VALUES(NULL,CONCAT(i+1,'@xxg.com'),i+1);
SET i=i+1;
END WHILE;
COMMIT;
END
复制代码 代码如下:
SELECT * FROM t_user WHERE email='222@xxg.com'; 耗时0.56 s
SELECT * FROM t_user WHERE email='222@xxg.com' LIMIT 1; 耗时0.00 s
新闻热点
疑难解答