Results 1 to 23 of 23
Jan 21, 2011, 13:15 #1
- Join Date
- Feb 2009
- Kathmandu, Nepal
- 0 Post(s)
- 0 Thread(s)
Speedy: ORDER BY RAND() operation
What can be done to make the following query run faster?
file_id is the primary key on the table (index)
# Random playlist SELECT file_name `title`, REPLACE(file_path, 'P:/', '') `location` FROM physical_files ORDER BY RAND() LIMIT 30;
There is an interesting post on similar topic on Anton Titov. Stil my problem cannot be solved. I cannot generate the list of random file_ids randomly in PHP, because, they may not exist or, filtered within WHERE condition.
Thank you in advance for a good suggestion.