Is it faster for the randomize the sort order of a large set of results on the MySQL server or after I have received the data in PHP?
Does anyone have any data to backup either side, or even anecdotal experience?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My educated guess is that MySQL wins hands down. It’s made to handle data this way. The sheer overhead of having to move all the data over to PHP for sorting gives it an advantange to boot.
You can find out for yourself by doing some benchmarking, of course.