Hacker News new | ask | show | jobs
by josenava 2150 days ago
I had to work on different projects where raw SQL queries where all over the place. This usually happens when the ORM does not help building very large dynamic queries or the developers just want to go the easy way and write the query in raw SQL rather than learning the ORM-specific way of doing it (I have done this myself a lot, to be honest).

In my opinion, I feel more comfortable tuning a raw SQL query to get better performance than tuning the ORM to work in a very specific way to run the very same query and get the performance benefit. However, for easy selects/updates it's more convenient using the ORM and getting the benefit of serializing the results to a domain entity