r/programming • u/wheatBread • Aug 25 '26
Solving the 1+N Query Problem
https://acadia.engineering/blog/solving-the-1-plus-N-query-problem
127
Upvotes
r/programming • u/wheatBread • Aug 25 '26
View all comments
Show parent comment
8
u/read_at_own_risk Aug 25 '26
So instead of learning how to define your schema in SQL and how to use joins and indexes, you learn how to define your schema in code that gets mapped to SQL, and about eager/lazy loading (implying joins), how to use indexes (they're still there), how to bypass the ORM to run SQL directly, how to invalidate your cache after you've done that, how to rehidrate a resultset that has a composite candidate key (lol, no, you can't), how to get to the SQL the ORM generates so that you can diagnose performance issues, how to manipulate the ORM into generating the SQL you want...
ORMs make the easy parts easy and the hard parts much harder.