D
D
dadaniel2020-11-23 15:10:20
PostgreSQL
dadaniel, 2020-11-23 15:10:20

How to optimize multi-field search across a small subset of rows in a table, Postgres and Django?

There is a table in basis in which approximately 200k records. search by one of the fields allows you to select about 3k records, which in turn need to be filtered by about a dozen more fields. How to optimize a query from django to cache a query that selects 3000 rows and then search only in this subset?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-23
@bacon

Start with indexes in the database, try a simple one on this field, then a composite one, well, with time measurements, otherwise it turns out that there is no problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question