Insert with massive amount of data

Asked

Viewed 168 times

1

Hello!

We are working on a project using PHP and Mysql database, in which at a given time a large scale of records should be inserted in the database (for example, between 5 thousand and 1 million),

At the moment, the most basic way to get performance we found would be to make a unique Insert.

INSERT INTO clientes(id, nome, cpf, email, telefone)
VALUES (1, "Lorem Ipsum", "09941752727", "[email protected]", "1140028922"),
       (1, "Lorem Ipsum", "09941752729", "[email protected]", "1140028922")...

The problem with this method is that it doesn’t check if the record has already been entered previously and also doesn’t allow us to check the progress of the insertion, so we can show on the screen how much remains to be completed.

Is there any way to solve these problems and still get a high performance in data insertion?

  • 3

    Inserts with bulk in a time table and create a procedure to read the table and do the insert/update

  • Thanks for the help, friend, it took me a while to implement because I am inexperienced in the subject, but I think I finally understood the benefits of doing so. Only one question about the Precedent, after reading the table the Index/update would be equal to the Index with the previous Bulk?

  • So if you’re struggling, edit your question with what you’ve tried so far and explain where it’s stuck so we can help :)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.