3 ms·
If you're working on Django codebases, `select_related` and `prefetch_related` are going to be your friends. Maybe 70-80% of Django slowness I've encountered (b
by yen223 6y ago
If you're working on Django codebases, `select_related` and `prefetch_related` are going to be your friends. Maybe 70-80% of Django slowness I've encountered (back when I did Django) was because of something issuing hundreds of db calls unnecessarily.
- Doxin 6y agoTo be fair, the django ORM makes it way too easy to do tens of thousands of queries and much too hard to collapse those down into join statements. select_related and friends will only get you so far.