It happens when you load a list of parents with one query and then trigger one extra query per parent to load related rows (for example each order's customer), producing N+1 queries and slow responses.
Fix with eager loading (joinedload or selectinload in SQLAlchemy), explicit joins, or batching, and detect it by logging SQL or using a query profiler in development.
Loading…