Donny Simonton wrote: > > Neil, > We never delete from primary tables. No questions asked! We would just > mark a entry as deleted, and not select from it. > > Another option you can do to solve your deletion problem is, select 35 rows > for example, when you really only want 30. That way, you can have extras, > if say #20 is not available. > > There are many options, we have even in some cases, created a table and run > the order by rand query every 5 minutes and just have it update a table. > And then we just do a select from that secondary table. So every 5 minutes > you have new random items.
Thanks again - lots of great suggestions. I use a reverse proxy caching front end Web server which allows me to reduce load on the back-end MySQL/mod_perl Apache processes. Thus by setting the expiration time of the web pages appropriately I can reduce the number of times the random pics page is executed, which kinda/sorta does what your last suggestion suggests, I think. I am all in favor of simplifying application code wherever possible, and I would still love to just use a simple query with "ORDER BY RAND()", it would make things SOOO much more straightforward. So if any of the core MySQL developers are reading this, please take a look at the original question and let me know if there are any plans in the works to make this more efficient (or if it's even possible - if it's just inherently difficult then that would be good to know). Thanks, -Neil -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]