table1 has less than 10k rows table2 has 1000 rows insert into table1 select a,b,c,d,e from table2 where concat(a,b) not in (select concat(a,b) from table1)