数据库 - MySQL中,如何在“多次查询100条”、“一次查询100条数据”中取舍?
阿神
阿神 2017-04-17 11:53:14
0
1
843

如果考虑网络环境,那肯定是一次查询100条数据的快,但是如果不考虑网络环境呢?只考虑MySQL的查询速度,是查询100次每次一条的快,还是一次查询100次的快?

阿神
阿神

闭关修行中......

reply all(1)
伊谢尔伦

It is generally faster to query 100 items at a time. Mainly to explain the sql statement, plan the query method, and the cost of index searching, etc. In addition, the difference between queries that do not use indexes and scan the table is more obvious. One scans from beginning to end to find all the data, and the other scans 100 times each time. Scan from the beginning...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template