Welcome Guest, Not a member yet? Register   Sign In
Database query caching not working
#5

[eluser]TheFuzzy0ne[/eluser]
[quote author="fchristant" date="1242928168"]- open a connection automatically when I perform a query that has no cached results.[/quote]

That's a nice idea, but I'm not sure it's necessary. Simply connecting to a database should not cause any performance issues.

[quote author="fchristant" date="1242928168"]- reuse that same connection for multiple queries from the same page. my research shows a new connection is opened for each query.[/quote]

Have you set pconnect to TRUE in database.php for your database connection?

[quote author="fchristant" date="1242928168"]- if I autoload the database, I open connections even when not needed. the database class really needs a lazy loading connection initializer[/quote]

One of the best things about CodeIgniter is that it's almost fully extendible. Unfortunately, "almost" means that there are several core files (including some of the database files), that can't be easily extended. However, it should be possible to abstract it as a library and extend it.

You'll need to call your library something other than database, unless you extend the loader too.

[quote author="fchristant" date="1242928168"]I think managing connections smarter is crucial for scalability, or am I overlooking what is currently possible in CI?[/quote]

I guess it depends. I think CodeIgniter scales well, but that's not from experience. I say that because usually as an application grows larger, resources are expanded to cope with more requests.

CodeIgniter is built with simplicity in mind, and whilst some things may be better implemented a differently, it's still very efficient compared to a lot of other frameworks. If you look through the source code, you will see that a huge effort has been made to keep bloat out of the code. I think that's why CodeIgniter leaves such a small memory footprint.

But again, those are other issues not related to this problem.[/quote]


Messages In This Thread
Database query caching not working - by El Forum - 05-21-2009, 05:52 AM
Database query caching not working - by El Forum - 05-21-2009, 06:13 AM
Database query caching not working - by El Forum - 05-21-2009, 06:39 AM
Database query caching not working - by El Forum - 05-21-2009, 06:49 AM
Database query caching not working - by El Forum - 05-21-2009, 07:08 AM
Database query caching not working - by El Forum - 05-21-2009, 11:30 AM
Database query caching not working - by El Forum - 05-21-2009, 11:38 AM
Database query caching not working - by El Forum - 05-21-2009, 12:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB