Home >Backend Development >PHP Tutorial >Solution to the problem that CI framework takes up too much memory when executed under CLI_PHP tutorial

Solution to the problem that CI framework takes up too much memory when executed under CLI_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:24:401300browse

Many programmers will always encounter excessive memory when using the codeigniter CLI to import a large amount of data. Here are the reasons and solutions for this analyzer.

CI db will save all query sql and sql execution time. For import problems like millions of large data volumes, the executed sql records will be saved in the content , which takes up a lot of content until the end of the script.

Solution:
When you perform a large number of db operations, remember to set:

Copy the code The code is as follows:

$this->db->save_queries = FALSE;

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825346.htmlTechArticleMany programmers will always experience excessive memory when using codeigniter CLI to import large batches of data. In this case, the reasons and solutions for this analyzer are as follows. CI db will...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn