CodeIgniter Forums
Active record class VS simple query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Active record class VS simple query (/showthread.php?tid=24171)

Pages: 1 2


Active record class VS simple query - El Forum - 11-05-2009

[eluser]BrianDHall[/eluser]
[quote author="saidai jagan" date="1257422833"]Thanks fa u r reply !! Smile.
so shall i use query() rather than get()?.[/quote]

You should use whatever you prefer, in my opinion the relative performance is not of material interest - I'd disregard it completely.

I use ORM (DMZ), but when I didn't I preferred get() because I used select() and where() and all that.


Active record class VS simple query - El Forum - 11-05-2009

[eluser]ChazUK[/eluser]
What about for complex queries, say joining 2 tables together and limiting the amount of columns being displayed?

I think query should be faster after that.

And you should always be limitting the information you are grabbing from a db, SELECT * is the devil.


Active record class VS simple query - El Forum - 11-05-2009

[eluser]überfuzz[/eluser]
When it comes to db handling you could save a lot of time by structuring you tables properly. But even if you're not doing this there has to be quite a lot of data/rows to make it feel laggy for the user. I helped a dude to calculate some statistics, on genes. There you got an example of where structure and proper a query end up altering the execution time quite a lot.