3 ms·
That doesn't sound like a good ORM. They should be lazy until you access the relevant data. That said. This is where the knowing what's going on behind the sc
by ehutch79 4y ago
That doesn't sound like a good ORM. They should be lazy until you access the relevant data.
That said.
This is where the knowing what's going on behind the scenes matters.
- ryanbrunner 4y agoOh they would be lazy, it's just that expressing something like that efficiently (i.e. something like "SELECT foo.*, (SELECT count(1) FROM bar where foo_id = foo.id") is usually really hard to do. Most ORMs I've seen would N+1 on that with a naive approach, and even the "optimized" approach will want to fetch all bars vs. just the counts.