Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django select_related and prefetch_related

django select_related and prefetch_related

select_related >> foreignkey
prefetch_related >> many to many
basically they are performance boosters ,used to avoid multiple unnecessary queries
Both methods achieve the same purpose, to forego unnecessary db queries. 
But they use different approaches for efficiency..
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django
ADD COMMENT
Topic
Name
5+9 =