PROFESSIONAL DJANGO ENGINEERING SERIES #5 100 orders. A loop. A template that accesses order.user.email. Result: 701 database queries.

Here is how it happens — and how to fix it in one line. The N+1 query problem is the most common performance issue in Django applications. It is also the most invisible one in development, because your local database has twenty records. It only becomes visible in