An application is running, the database is responding, and individual features seem to work as expected. But as the number of users and the amount of data grow, some pages start loading more and more slowly. The cause might not be an underpowered server or a poorly designed database. Sometimes, the problem is simply that the application is executing too many unnecessary database queries.
This issue is known as the N+1 Query Problem, and it can occur in Django applications as well. The good news is that, in many cases, it can be resolved with a relatively simple optimization.