Home  >  Article  >  Backend Development  >  background-repeat mysql_num_rows VS COUNT efficiency problem analysis

background-repeat mysql_num_rows VS COUNT efficiency problem analysis

WBOY
WBOYOriginal
2016-07-29 08:44:561596browse

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.

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