Hi All,

I understand that I can get a random row out of a table by doing something 
like

SELECT * FROM fortunes ORDER BY RAND() LIMIT 1

But I have also been told that this is a very slow operation.

I am building a script that will display a random saying, user testimonial, 
whatever, on a web page.  Since this is a public page (i.e., not an admin 
backend), I have to be concerned about speed.  What is the best way to get a 
random row out of a database for this sort of application?  It's the sort of 
thing you see all the time, so I'm sure others have thought about this 
before.  Any pointers?

Sincerely,
  -Josh 




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to