CodeIgniter Forums

Full Version: Active record class VS simple query
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[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.

El Forum

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.

El Forum

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.
Pages: 1 2