How does MySQL's ORDER BY RAND() work?

后端 未结 4 1527
渐次进展
渐次进展 2020-11-29 03:02

I\'ve been doing some research and testing on how to do fast random selection in MySQL. In the process I\'ve faced some unexpected results and now I am not fully sure I know

4条回答
  •  不知归路
    2020-11-29 03:21

    Why don't you add an index id, username on the table see if that forces mysql to use the index rather than just a filesort and temp table.

提交回复
热议问题