3 ms·
The typical use of ORMs that kills the database is where one uses record-based operations to traverse a set: resulting in one query per record. The blogger's p
by clarkevans 15y ago
The typical use of ORMs that kills the database is where one uses record-based operations to traverse a set: resulting in one query per record.
The blogger's point is quite good: a developer probably doesn't know what SQL is being generated, it may be opaque how small variants in query source can result in radically different SQL based on the translation process. Hence, a profiler should be used to find problematic queries. This is solid advice.
What's not mentioned though is that sometimes what appears to be very ugly SQL actually out-performs pretty, parsimonious, hand-crafted SQL. This, assuming the developer could actually craft correct SQL equivalent.