Answer the question
In order to leave comments, you need to log in
Laravel. Thousands entry in DB?
Hello.
Help Wanted.
Short. Website, October CMS. There is a table in .xls. There are about 50 columns and about 100 rows. Respectively - 5000 data.
I am uploading a file, parsing data from there and I need to add it to the database. I'm starting to add to the database. After 120-150 entries, the request flies without giving any error.
I need to record as soon as possible. And without loss. Guys, can you advise? Has anyone made an example of such a request? How???
Thanks in advance.
Sincerely, IGCapiti.
Answer the question
In order to leave comments, you need to log in
Break the process into parts. Parse the first 100 rows and insert them into the database. Then repeat the rest of the lines in the loop.
You can think of several options ... it depends on the task ...
For example, when parsing a file, you can "throw off" the necessary data into another resulting file ...
And then run this file through such a request:
It will fly in quickly ...
More details here .
As I understand it, saving is now working for you according to this principle: 1 line = 1 request to the database? It is better to send a bundle immediately. 5000 records to interpose 1 query for mysql how not to do.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question