Welcome Guest, Not a member yet? Register   Sign In
Active Records Performance vs Raw Queries
#16

You cannot answer a question if raw SQL or Querybuilder is generally better. It is a trade off. Querybuilder adds some nice features at the costs of some speed. Raw SQL is always faster but you will not have some of the benefits of Querybuilder.

You will have to decide what you define as "better". Is that for example the fastest method of executing a query then raw SQL is the better one. If you like some of the features in Querybuilder or want your app to be more interoperable, like being able to migrate to another database like Narf mentioned, without much headache then Querybuilder is better.

I prefer to use Quirybuilder. I believe there is room for improvement in every application in some query, database structure optimization or a php loop that will way more impact than switching from Querybuilder to raw SQL. If you run into performance issues you need to solve the issue itself, don't expact that switching from Querybuilder to raw SQL is some miricle solution Wink

Does anybody have some benchmarks data which shows some difference in speed between raw SQL vs Quirybuilder?
Reply


Messages In This Thread
RE: Active Records Performance vs Raw Queries - by Diederik - 02-03-2016, 01:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB