In this video, I'm gonna be showing you what exactly is select_related in Django. We will demonstrate Django select_related by making use of an example project which has two models and these models are related to each other using Foreign Key. We will show you what exactly is the use case of Django select_related by querying the Django models and showing the corresponding SQL queries being executed in the background by making use of django debug toolbar. We will then explain the problems with the default accessing method and specifically about the n+1 query problem in Django ORM. Then, we will fix the n+1 problem using Django select_related. We will also talk about the underlying SQL queries being executed if we use select_related. This video is a part of Django Relationships series and the next video in this Django Relationships series would be Django prefetch_related.
Subscribe | Code Band
Django select_related Docs : [ Ссылка ]
Django Debug Toolbar : [ Ссылка ]
Django prefetch_related Examples|Django select_related and prefetch_related|Django n+1 Query Problem : [ Ссылка ]
Other videos in Code Band:
Django Autocomplete with jQuery UI | AJAX | Search | Filter from Database | Tutorial | Code Band : [ Ссылка ]
Django Seed Data into Database Models | Django Faker | Django loaddata | Django Dummy Data : [ Ссылка ]
3 Cool Django Features that Django Developers are Not Aware of : [ Ссылка ]
Build a Weather App in Django | Scrape Weather Data from Google | Beautiful Soup | Python Requests : [ Ссылка ]
Django Custom User Model | Email as Username | Phone as Username | Authentication Example |Code Band : [ Ссылка ]
Playlist | Django Authentication | The easiest and actual way of doing it : [ Ссылка ]
Playlist | Django Relationships | Explained with Example by Code Band : [ Ссылка ]
Custom Model Manager & Model QuerySet in Django : [ Ссылка ]
Render Django Form Manually : Make Custom Form with Form Validations - [ Ссылка ]
Generic Class Based Views in Django | Introduction & Create View in Django | Learn by Example | CRUD : [ Ссылка ]
How to Deploy Django Project on Heroku for Free : [ Ссылка ]
Connect Django with MySQL : [ Ссылка ]
Instagram Automation using Python : [ Ссылка ]
Top 5 Programming Languages to Learn in 2020 : [ Ссылка ]
:) You Can Find Me On:
My Website - [ Ссылка ]
Linkedin - [ Ссылка ]
Github - [ Ссылка ]
Facebook - [ Ссылка ]
Twitter - [ Ссылка ]
Instagram - [ Ссылка ]
![](https://i.ytimg.com/vi/mO-pfdJpnBA/maxresdefault.jpg)