top | item 16809938

(no title)

zv | 8 years ago

Raw SQL queries will perform fast if you write correctly. No ORM will stand close. Stored procedures help a lot. It's close to C/C++ in a sense that is easy to shoot yourself in the foot.

On other hand, ORM helps to write code that can be unit tested and you can test that some data retrieval conforms to certain principles.

discuss

order

olavk|8 years ago

Hand-written SQL is not intrinsically faster than ORM generated SQL. The instances where ORM's have worse performance is typically due to application errors like n+1 queries or forgetting to batch updates. If you actually know what you are doing you can typically do the same optimization on the ORM level.