BLOG

Denver Website Development at Fusionbox | Colin Thomas-Arnold

Fetch a random row from the database without using triggers, and quickly.

Posted by colinta on March 18, 2010
database, SQL

It's a pretty classic SQL problem, and one that many blogs attempt to tackle – and do a poor job.  Most people are quick to recognize that ORDER BY RAND() is a bad idea.  So then they think that using MIN(id) / MAX(id) you can find a random index.  Also bad!  Let's see what can be done.

More »

Posted in: Database Administration, Programming 2 comments

CONTACT US Got a comment? Want a quote?
Email or call 303.952.7490

Denver Web Design | Search Blog

Search Blog

Denver Web Design and Development | Blog Archives

Archive

Denver Interactive Agency | Blog Categories

Categories

Denver Website Design | Blog Tags

Tags