A
A
Alex Xmel2020-04-19 19:58:17
Django
Alex Xmel, 2020-04-19 19:58:17

How to write a table to the django database, not a row?

There is a table, approximately 150 lines. If you pass it to the model line by line, then writing takes a very long time, and this action must be done once every 10 seconds. In this regard, I think how to transfer the entire table at once, and not line by line. What are the solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Sviridov, 2020-04-19
@dimuska139

For starters, I would try bulk_create , dividing these 150k into chunks of a certain (experimentally determined) size. In general, specify the task, please. It is not very clear why you need to write 150k lines to the database every 10 seconds.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question