We hear: Order by Rand() is bad for large tables. But how many rows is large?

Posted by ggg on Stack Overflow See other posts from Stack Overflow or by ggg
Published on 2010-04-02T10:58:06Z Indexed on 2010/04/02 11:03 UTC
Read the original article Hit count: 224

Filed under:
|

I use order by rand() LIMIT 1. I have a database with 150,000 rows and I'm getting split second results after a select of three tables. If I stay under a million rows, am I going to be OK?

At what point should I consider upgrading my code to something more sophisticated?

© Stack Overflow or respective owner

Related posts about random-generator

Related posts about mysql