CodeIgniter Forums
CI profile help for db qureis. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: CI profile help for db qureis. (/showthread.php?tid=70322)



CI profile help for db qureis. - umefarooq - 03-25-2018

Hi
I need some help on profile, i am running 10 db query on my home page including 4 models, but in profiling results it show for $db following

DATABASE:  cms (page:$db)   QUERIES: 10 (0.0427 seconds)  (Hide)

for any model call on same page results are following

DATABASE:  cms (Model_m:$_database)   QUERIES: 10 (0.0087 seconds)

my question is CI executing 10 queries on each db or model call if yes than it is calling 10 queries on each model load. this is really confusing please somebody clear it. these are just 10 calls or more.

in my CI 2 profile log it show each call under $db, but with CI 3 it show 10 query for $db, also on each model.


RE: CI profile help for db qureis. - InsiteFX - 03-25-2018

Does not sound right to me, turn on CodeIgniter's Profiler to see what is
happening.


RE: CI profile help for db qureis. - umefarooq - 03-25-2018

I am using following base model it is passing $this->db to $this->_database, on each model call it is showing this

https://github.com/jamierumbelow/codeigniter-base-model


RE: CI profile help for db qureis. - InsiteFX - 03-26-2018

That model everyone knows of, what I saw was that it was updated 4 years ago so I would check out the methods
they may not be up to date with the new version of CodeIgniter's Query Builder methods.