![]() |
Approach: Reducing the number of SQL calls - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Approach: Reducing the number of SQL calls (/showthread.php?tid=47059) |
Approach: Reducing the number of SQL calls - El Forum - 11-24-2011 [eluser]bunal[/eluser] Well you might not want to use ORM for your application and your application may be making the same SQL calls (in different models/libraries or ...) multiple times when it tries to show/render the page. Actually better to have a memcache or similar layer but here it is anyway. Here is my approach for this situation: Extend the CI_Model class to store the results of the SQL queries Code: class MY_Model extends CI_Model Example Code: class Category_model extends MY_Model { In basic having a singleton approach. Hope it helps someone. |