create table ten(a int);
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

create table one_k(a int);
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;

create table one_m(a int);
insert into one_m select A.a + B.a* 1000  from one_k A, one_k B;
delete from one_m where a=0 limit 1;

create table t1 (
  id int(10) unsigned NOT NULL AUTO_INCREMENT,
  filler varchar(100),
  subset_id int(11) DEFAULT NULL,
  PRIMARY KEY (id),
  KEY t1_subset_id (subset_id)
);

create table t1_subsets (
  id int(10) unsigned NOT NULL AUTO_INCREMENT,
  filler1 varchar(100),
  filler2 varchar(100),
  filler3 varchar(100),
  PRIMARY KEY (id)
);

insert into t1 select a,a, NULL from one_m where a < 50*1000;
insert into t1_subsets select a,a,a,a from one_m where a < 500*1000 limit 499000;
analyze format=json select * from t1,t1_subsets where t1.subset_id IS NOT NULL and t1.subset_id= t1_subsets.id;