Quorum
Play
ReferenceGlossary

N+1 query

Loading a list with one query, then running one more query per item to load its related data: N items cost N + 1 queries. ORMs cause it through lazy loading, which hides the extra queries behind normal-looking code. Eager loading fetches the related rows in one or two queries instead.

Data

In Quorum#

Laravel, Rails, and Django use an ORM that sends 3 read queries where 1 would do, on page views and API reads. A page view then costs the Database 6 reads instead of 2, which adds CPU there and waiting time on the App Server. Research Eager loading, then ship the Eager loading task (10 Dev Hours) to remove them; Symfony and the light frameworks never make them.

Connection pooling, Fan-out, Distributed tracing

Learn more#