Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获得查询的随机结果。我读到使用RAND()速度很慢。我可以使用order by uuid_short()吗?那会更好吗?
RAND()
order by uuid_short()
uuid_short()大约比 慢两倍rand(),所以不,你不应该使用而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)