I have a query which consists of joins and has an output of about 30,000+ records. I would like to get 10 random rows from these records without using SQL command ORDER BY rand().
I tried looping through the records and put them in an array and shuffle (get the 1st 10 after shuffle) them but it takes about 8-12 seconds to generate. I would like to reduce this processing time at all cost.
How will I accomplish this?