How to do random ordering in MySQL. Should I use random() or uuid()
I want to get randomized results for a query. I read that using RAND() is quite slower. Can I use order by uuid_short() ? Will that be better ?
uuid_short() is about two times slower than rand(), so no, you should not use uuid_short() instead of 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)