django prefetch select_related foreign key code example
Example: 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..