mysql max() 函数的需扫描where条件过滤后的所有行: 在测试环境中重现: 测试版本:Server version: 5.1.58-log MySQL Community Server (GPL) testtable表中的索引 mysql> show index from testtable;+-----------+------------+------------+--------------+-------------+-----------+---------…
解释 官方文档中: The difference between min and minBy is that min returns the minimum value, whereas minBy returns the element that has the minimum value in this field (same for max and maxBy). 翻译: min和minBy之间的区别是min返回最小值,而minBy返回在此字段中具有最小值的元素(与max和maxBy相同)…