mysql 快速批量导入测试数据
drop procedure if exists wk;
create procedure wk()begin
START TRANSACTION; //加前后100条数据5秒 加入后10000条变为0.8秒
set @a=1;
while @a<10000 do
set @b=unix_timestamp();
insert into reward_record(r_uid,create_time,su_uid,user_ip,item_uid)
values(@a,
@b,
rand()*100,
CONCAT( ceil(rand()*255),'.',ceil(rand()*255),'.',ceil(rand()*255),'.',ceil(rand()*255)),
rand()*10);
set @a=@a+1;
end while;
COMMIT;
end;
call wk();