Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This doesn't fully make sense to me...

I'm kind of curious about what data the select limit 1 queries were returning that the ORM couldn't get in a single query and had to go back per record. Can you shed any light on this?

ORMs have a degree of flexibility. It's possible to write n+1 queries accidentally, especially for developers who are new to the ORM. It's also often possible to address those issues. Sometimes trivially, sometimes not.

The other thing that comes to mind here is that maybe the query was hitting a non-covering index and that was triggering the lookups? In that case a covering index would have fixed the issue?

Curious about this one...



It is almost certainly someone using lazy-loading when they should have disabled it for that query.

Though... since it sounds like the query was returning the entire table at once eager loading will cause issues of another variety at some point.

Either way, I'd chalk it up to bad design rather than bad tools.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: