View Single Post

  #4 (permalink)  
Old 06-01-2007
Jon Slaughter
 
Posts: n/a
Default Re: faster/less intensive way of getting a random row from db?


"flagman5" <flagman5@gmail.com> wrote in message
news:1180652488.053756.143240@j4g2000prf.googlegro ups.com...
> On May 31, 3:10 pm, strawberry <zac.ca...@gmail.com> wrote:
>> SELECT * FROM my_table ORDER BY RAND() LIMIT 1; ?

>
> sir, u missed my points completely. and also I need to avoid rand()
> function as it is documented to be very slow on big tables.
>


How the hell do you expect to get a random entry without using random
numbers?

Why not generate a list of random numbers before hand and use them if your
concerned with the speed of rand()?


Reply With Quote