title: CodeIgniter MySQL query using too much memory - How can I use MySQL's SSCursor?
body: <p>I'm working on an application using CodeIgniter for database access. The application issues queries like these: <code>$this-&gt;db-&gt;query("SELECT fields_list FROM table_name");</code>
  But the table has hundreds of thousands of records.</p>
  
  <p>CodeIgniter tries to load the whole result set into memory, causing the script to reach memory limit.</p>
  
  <p>The way around this issue is to use libmysqlclient API's SSCursor but I can't see any example of CodeIgniter using SSCursor. Is there a way to use MySQL's SSCursor in CodeIgniter?</p>