4 ms·
This is ancient knowledge and I would have agreed with you 15 years ago, today the only reason to not use an ORM is analytical queries. Since the Postgres plan
by aeyes 4y ago
This is ancient knowledge and I would have agreed with you 15 years ago, today the only reason to not use an ORM is analytical queries.
Since the Postgres planner doesn't really allow you to tune your query there aren't many ways to construct your query in a way which would to a much worse execution plan. Over the years we have migrated most raw SQL back to using the ORM without taking performance hits, pretty much the only remaining raw queries are CTEs where we force a certain order of query execution.
Usually these ORM problems are caused by schema design anyways. If you need 10+ joins you are going to have a hard time with or without an ORM.