


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

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

CREATE TABLE wp_postmeta (
  meta_id bigint(20) unsigned NOT NULL auto_increment,
  post_id bigint(20) unsigned NOT NULL default '0',
  meta_key varchar(255) default NULL,
  meta_value longtext,
  PRIMARY KEY  (meta_id),
  KEY post_id (post_id),
  KEY meta_key (meta_key)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

insert into wp_postmeta (post_id, meta_key, meta_value)
 select 
    seqno / 8,
   concat('key', MOD(seqno, 8)),
   concat('data-', seqno)
from
(
  select A.a+ 1000*B.a as seqno
  from one_k A, one_k B
  where
    B.a<500
) as T;
