background-repeat mysql_num_rows VS COUNT efficiency problem analysis

WBOY
Release: 2016-07-29 08:44:56
Original
1623 people have browsed it

Both mysql_num_rows and count(*) can count the total number, which one is better?
Or
When to use num_rows and count(*) respectively
An intuitive comparison
Test data:
Number of items: 139764 items
Data table size: 500M
Result:
fetch_num_rows time: 35.272329092026
count(*) time: 0.071956872940063
If the number is simply counted, of course it is count(*)
fetch_num_rows must traverse the database to find that the efficiency is lower than count(*)

The above introduces the analysis of background-repeat mysql_num_rows VS COUNT efficiency issues, including the content of background-repeat. I hope it will be helpful to friends who are interested in PHP tutorials.

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