Wednesday, January 28, 2009

MySQL Random Row

For retrieving random records in MySQL, using "ORDER BY RAND()" may be a quick solution for small tables, but larger tables can be performance problems. This issue came up in a recent MySQL Professionals LinkedIn discussion.

There were some good replies and my own digging around led me to this great resource:
http://jan.kneschke.de/projects/mysql/order-by-rand/

No comments: