Welcome Guest, Not a member yet? Register   Sign In
Daft newbie question: active_record vs standard mysql query
#1

[eluser]edjon2000[/eluser]
First of all I would like to wish you seasons greetings,

I have recently been playing about with CI's active record class, mainly due to a problem I was having with an ongoing project, whereas before, I was using standard MySQL type queries because this was what I was familiar with, however it seems to me that using CI's active_record class generates faster results, has anyone actually put this to the test? I kind of thought that the processing overhead would have yielded slower results but active_record seems to respond quicker.

Has anyone any thoughts on this point?

Jon
#2

[eluser]mi6crazyheart[/eluser]
I exactly can't say whether using active record generate some delay in query executing(may be yes little bit) but using active record is really kill u'r lot of tensions which u could probably get if u make plain sql query to mysql. Like.. it has make query safe from sql injection, u can use multiple RDBMS easily, easy to memories, Error tracking much more easy etc.

In fact, such things(ORM, Active record pattern) really popular when it needed to work with different kind of DB.
#3

[eluser]edjon2000[/eluser]
Hi mi6crazyheart,

Sorry for not replying earlier been very busy with my current web project, I actually changed all of the standard MySQL queries to use active record instead, and, as far as I can see the response times are about the same if not slightly quicker, one of the main advantages apart from it working with different types of databases is the fact that it takes care of a lot of problems with escaping database queries to make tham safe, so it has actually simplified my coding quite a lot.

Many thanks for your help and advice, and all the best for 2011

Jon




Theme © iAndrew 2016 - Forum software by © MyBB