Home  >  Article  >  Backend Development  >  一次性读掏出所有数据和limit分批读出数据哪个好

一次性读掏出所有数据和limit分批读出数据哪个好

WBOY
WBOYOriginal
2016-06-13 11:40:11897browse

一次性读取出所有数据和limit分批读出数据哪个好啊
在采集时,比如数据库有10万条记录url   是列表页面的网址

1、一次性从数据库读出这10万条url,然后foreach进行采集
2、先limit10条, foreach采集完,再读取数据库limit,不断重复

一般用哪种方法啊?

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