A
A
Alexander2020-02-04 18:27:46
Django
Alexander, 2020-02-04 18:27:46

What are the ways to unload a db on django?

There is a model, it has
8 simple fields (int, char),
2 Forein key,
1 many to many
2 JSONField (100 keys each)
Now there are 5000 records and the speed of obtaining is growing rapidly (1 object - 0.15 sec., at the beginning was 0.04). There is an idea to move JSONField into separate models, but sometimes you still have to merge . Are there any other optimization options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mayton2019, 2020-02-04
@mayton2019

You do two DB. Also you write in one all records satisfying HASHCODE (primaryKeys, 2) == 0
and in the second DB HASHCODE (primaryKeys, 2) == 1. At requests . you do request in two DB and unite result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question