← Graph

N+1 Queries

concept 6 connections

Common ORM performance problem where the number of database queries is proportional to the number of rows loaded. In GraphQL it is particularly painful because API clients choose what fields to request, so static eager-loading strategies used in REST don't apply. Mitigated with batch loaders (graphql-batch), preload helpers (graphql-preload), and predictive preloading via graphql-ruby's look_ahead.

category
pattern
about
N+1 Queries concept
Listed as a must-know topic for Ruby data engineers.
about
N+1 Queries concept
Notes the SQLite docs' advice that you should probably not prematurely optimize away N+1 queries when using SQLite.
N+1 is framed as the classic GraphQL performance problem.
about
N+1 Queries concept
Database bottlenecks were flagged as the stereotypical starting point.
about
N+1 Queries concept
Question about whether SQLite removes the N+1 problem.
about
N+1 Queries concept
Cited as an example of issues nearly unique to the Rails ecosystem

Provenance

Read by
8 extractions