<p>Django <code>prefetch_related</code> makes an extra query to pre-fill the related objects. If you use <code>prefetch_related</code> 3 times in the same queryset Django ORM will hit the database 4 times to fetch all the results.</p>
By clicking “Accept all”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. Check our privacy policies.