P
P
prrrrrrr2020-07-21 14:21:08
symfony
prrrrrrr, 2020-07-21 14:21:08

How to optimize a query in which you need to send, for example, 3 thousand rows and add them to the database?

Tell me how to optimize a query in which you need to send, for example, 3 thousand rows and add them to the database?

Send json:

{
"users": [
1000,
...
4000
]
}

both the server and postman start to fall off. how can i solve the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Derepko, 2020-07-21
@uDenX

Start a transaction manually, prepare a request and send the data already. After sending all the data, make a commit.
If about the doctrine, then read this

N
Nikita Pushkar, 2020-07-28
@NickPush

If you need the page not to freeze while all this is being done, then use Message (MessageHandler) in symphony, it is very well implemented. Let these requests be made asynchronously. You can see how this is done on symfonycast,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question