MySQL构造测试数据

构造测试数据(笛卡尔积,6 次100 万)

create table t1(id int, val varchar(80));

set @i := 0;
create table tmp as select (@i := @i + 1) as id from information_schema.tables limit 10;

set @i := 0;
insert into t1 select @i := @i + 1, substr(concat(sha1(rand()), sha1(rand())), 1, floor(rand() * 80)) from tmp a, tmp b, tmp c, tmp d, tmp e, tmp f;

原文地址:https://www.cnblogs.com/hankyoon/p/6894955.html