S
S
Sergey Eremin2014-08-12 23:58:32
Django
Sergey Eremin, 2014-08-12 23:58:32

Where is the fastest sorting in python / django of calculated SQL fields? .. Through models or direct SQL queries?

Actually the whole point of the question in subj.
I heard a lot about Django MeetUp about query optimization, and about how crookedly ORM sometimes "draws" all sorts of joins and unions ... I have to use sorting by calculated fields quite intensively, and now I have doubts about the speed of ORM. Who will have recommendations?
The actual task is to find in millions of records (X1, Y1, Z1) the closest to the required ones (X2, Y2, Z2) and build distributions of all these records. Everything is complicated by the fact that X, Y, Z is only part of the data. After a selection is made on them, it will also be necessary to extract the text fields, parse them and sort them again according to some criteria. But the second part of sorting can already be done, incorrectly, using Python tools without any SQL. There will be not millions of records, but a maximum of one or two thousand.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
some1else, 2014-11-27
@some1else

Judging by the question, do you doubt that the backend of a normal database is faster than similar calculations with the received rows already in python? IMHO, processing on the side of the database is a priori faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question