I
I
IGCapiti2019-12-25 04:04:13
MySQL
IGCapiti, 2019-12-25 04:04:13

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

4 answer(s)
A
Anton, 2019-12-25
@karminski

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.

N
N, 2019-12-25
@Fernus

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 .

N
Nikita Krasnikov, 2019-12-26
@YekitKsv

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.

X
Xukaro, 2019-12-26
@Xukaro

How about migrations? Uploading a file, even a fairly large one, will not take much time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question