1
I have 70MIL records to insert into one Tabela3 from Tabela1 - 4 fields and table 2 - 1 field. The following code does exactly what I need the most optimized way a user has helped me build.
INSERT INTO imagens3 (ID, IMOVEL, CODIGO, IMAGEM_G, IMAGEM_P)
SELECT t1.ID, t1.IMOVEL, t1.CODIGO, t2.IMAGEM_G, t1.IMAGEM_P
FROM imagens1 t1 INNER JOIN imagens2 t2 ON t1.ID = t2.ID LIMIT 10000
I need to insert 10MIL at a time to get to the end of my work successfully.
How I can create an instruction to insert 10MIL records at a time through php?
I don’t work with php, but can you work with a list? Because then you could use the IN command in your mysql, and pass part of that list by execution blocks. NOTE: The IN command accepts up to 2100 records. I hope I helped. Otherwise, comment so we can analyze better.
– WyllianNeo
2100 records is little. This will not solve my problem.
– Marcos Vinicius
Yes, I know, I had this same problem these days but in Java, and I had to do one for every 2100 records to do the insertion. In my case, it was worth doing as a block for the performance, but this in Java, I don’t work with PHP, so I didn’t post as an answer, but maybe it’s an option.
– WyllianNeo