Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Knowledge base documentation
Knowledge base documentation

Django

  • 1. Existence of key inside a nested json field in Django with PostgreSQL
  • 2. How to use explain from sql in a Django queryset
  • 3. List all related model in Django
  • 4. Safely move a model between apps

Linux

  • 1. Usefull command for CEPH
Back to top

2. How to use explain from sql in a Django queryset¶

It’s now built-in in Django!

2.1. Usage¶

print(MyModel.objects.filter(...).explain())

Source:

  • Dalibo: Postgres Explain Visualizer 2

Tags: Django, Python, PostgreSQL, Explain, SQL, QuerySet, Debugging

Next
3. List all related model in Django
Previous
1. Existence of key inside a nested json field in Django with PostgreSQL
Copyright © 2025, Legrems
Made with Sphinx and @pradyunsg's Furo
On this page
  • 2. How to use explain from sql in a Django queryset
    • 2.1. Usage