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

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

WBOY
Release: 2016-06-13 11:40:11
Original
937 people have browsed it

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

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

一般用哪种方法啊?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template