Comment

Comment by pugio

n+1 queries can be solved in many different ways – you can easily do`User.all.includes(:character_sheet)` for example, to perform just 2 queries: 1 for users, 1 for their character sheet.

The nice thing about first-class production sqlite support is that even if you do end up with n+1 queries, it's not as big a deal: https://www.sqlite.org/np1queryprob.html

Certainly I wouldn't care about it while prototyping. I can always go back and optimize queries with judicious `.joins()` or `.includes()` if it becomes a bottleneck.

parent pugio 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton