i want to select some random rows from table of more than 25000 rows,, i know that ORDER BY RAND() will take too much time,, please provide a easy method to get 20 random rows out of 25000 rows,, thank you
It would be easy if you use a SSL like php. You could just use php to generate a randome number between 0 and 25000 and the use that number plus twenty in your MySQL Query's LIMIT VALUE
the index value won't be in order, there are lots of gaps like 1,2,4,5,7,8,14....... so here will be problem,,
There's no way to do it outside of the database if the keys are not in order. You could select the keys and then run a random function in the application, but this could be slower. Probably worth a try.