我想获得查询的随机结果。我读到使用 RAND()
的速度相当慢。我可以使用 order by uuid_short()
吗?那会更好吗?
最佳答案
uuid_short()
大约比 rand()
慢两倍,所以不,你应该不使用 uuid_short()
而不是 rand()
。
mysql> select benchmark(100000000, rand());
1 row in set (3.25 sec)
mysql> select benchmark(100000000, uuid_short());
1 row in set (6.04 sec)
关于mysql - 如何在 MySQL 中进行随机排序。我应该使用 random() 还是 uuid(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11031307/