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 : https://docs.djangoproject.com/en/3.0/ref/models/querysets/#select-related
Django Debug Toolbar : https://youtu.be/qWLk9S6mvAY
Django prefetch_related Examples|Django select_related and prefetch_related|Django n+1 Query Problem : https://youtu.be/5-UN4YPDDQc
Other videos in Code Band:
Django Autocomplete with jQuery UI | AJAX | Search | Filter from Database | Tutorial | Code Band : https://youtu.be/-oLVZp1NQVE
Django Seed Data into Database Models | Django Faker | Django loaddata | Django Dummy Data : https://youtu.be/QUXvqfN1ENM
3 Cool Django Features that Django Developers are Not Aware of : https://youtu.be/ljfeFx6QJOM
Build a Weather App in Django | Scrape Weather Data from Google | Beautiful Soup | Python Requests : https://youtu.be/-gzUIPyBRJg
Django Custom User Model | Email as Username | Phone as Username | Authentication Example |Code Band : https://youtu.be/SbU2wdPIcaY
Playlist | Django Authentication | The easiest and actual way of doing it : https://www.youtube.com/playlist?list=PLbasZIkCgHJEQkL2pKTstb4JGrGO6SF9R
Playlist | Django Relationships | Explained with Example by Code Band : https://www.youtube.com/playlist?list=PLbasZIkCgHJH38p2WkC5GTsgoV_8hlQ4A
Custom Model Manager & Model QuerySet in Django : https://youtu.be/zQpYokJN34s
Render Django Form Manually : Make Custom Form with Form Validations - https://youtu.be/PMRalI2M3SY
Generic Class Based Views in Django | Introduction & Create View in Django | Learn by Example | CRUD : https://youtu.be/RBKjarWdUq4
How to Deploy Django Project on Heroku for Free : https://youtu.be/V2rWvStauak
Connect Django with MySQL : https://youtu.be/RCbRjacna20
Instagram Automation using Python : https://youtu.be/5pIqwVSNzX4
Top 5 Programming Languages to Learn in 2020 : https://youtu.be/WM0WCMpYCx0
:) You Can Find Me On:
My Website - https://jasim.tech/
Linkedin - https://in.linkedin.com/in/akjasim
Github - https://github.com/akjasim/
Facebook - https://www.facebook.com/jasimakjasim
Twitter - https://twitter.com/akjasim
Instagram - https://www.instagram.com/jasim_ak/