4 ms·
People generally don’t take the time to learn the framework and miss out on the tooling it provides. select_related for example. If I had a dollar for every pro
by pryelluw 1y ago
People generally don’t take the time to learn the framework and miss out on the tooling it provides. select_related for example. If I had a dollar for every project I’ve been hired to work on that didn’t use it, well, I actually do.
Also, people in general don’t seem to be able to do more than very basic SQL, so creating views is seen as a little known performance “trick”.
In general, people who don’t read the manual.
- nojs 1y agoFYI you can avoid the manual sprinkling of select_related somewhat with https://pypi.org/project/django-auto-prefetch/ https://pypi.org/project/django-auto-prefetch/, which avoids the lowest hanging N+1 loops automatically. Definitely not a cure all but it helps.
- vecter 1y agoAh yes. That’s the one thing I need to teach everyone when they’re new to Django. I was wondering if there were other quirks to the ORM beyond avoiding N+1 queries.