3 ms·
haven't we learned that order by rand() is a bad idea?
by axiak 16y ago
haven't we learned that order by rand() is a bad idea?
- compay 16y agoThat depends on how and when you're going to use it. It's fine with small data sets, or if you're going to run the query and cache its output periodically. With MySQL you can also speed it up quite a bit by selecting only an indexed column rather than `SELECT *`. But yeah, if it's in a query that you're going to run on every single hit to the index page of a busy site, then you're going to have problems.