Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3 only connect to database if theres queries to run?
#1

I'm using CI3 and I noticed that every time that I enter to any Controller a connection to the database is made even if is not needed.

I used the Profiler ( $this->output->enable_profiler(TRUE); ) to see the performance and when I remove the database library from the autoload.php the pages that don't use any queries loads a lot faster. I've read the Docs but don't see any related to connect to the database only when a query is needed, for the moment I'm only importing the ( $this->load->database(); ) in each model instead of importing it in the autoloader and loading the models only when needed.
Is there any easier option to this behaviour with the Database Library?

Thanks.
Reply


Messages In This Thread
CodeIgniter 3 only connect to database if theres queries to run? - by Yaiko - 04-22-2022, 12:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB