3 ms·
Hibernate generates optimal SQL in all situations for all databases and their different dialects? Really?
by gaius 17y ago
Hibernate generates optimal SQL in all situations for all databases and their different dialects? Really?
- jrockway 17y agoI'm just saying that the optimizer sucks if semantically identical queries don't execute the same instructions against the database. I would certainly not be surprised if this happens in real life... but the solution is to not to hand-code every SQL query, it's to fix the database.
- gaius 17y agoYou speak as if writing SQL was some unpleasant or arduous task, whereas in reality it's just a DSL for data. In most cases an ORM is just another layer of complexity.
- gnaritas 17y ago> In most cases an ORM is just another layer of complexity. That unlike SQL, drastically reduces the amount of code the programmer is forced to write for the vast majority of applications that programmers write. SQL can't do the one thing most programs actually need, give them the ability to select a starting point, and then navigate the conceptual graph of data as the user moves around the application. ORM's provide that, object database provide that, SQL doesn't.
- wvenable 17y agoYou're right, and that's what great about ORMs! But if you're asking a question of your data, like "how many widgets did I sell today?" then navigating a conceptional graph of data is the slowest, most convoluted, way of getting at that information.