Re: [PHP] SQL - RANDOM

2008-11-24 Thread Korgan
thx it looks good [EMAIL PROTECTED] napsal(a): For large tables, I generally create a "static_rand" column, and pre-populated it with random numbers and create an index on it. Then, after "using up" the records, I have application logic to reset those records (and only those records) to new r

Re: [PHP] SQL - RANDOM

2008-11-24 Thread ceo
For large tables, I generally create a "static_rand" column, and pre-populated it with random numbers and create an index on it. Then, after "using up" the records, I have application logic to reset those records (and only those records) to new random numbers. This provides MUCH better per

Re: [PHP] SQL - RANDOM

2008-11-24 Thread Chris
Korgan wrote: Hi, i would ask what is the best method for random select from database. I have table with 20k items.. - If i use ,,select * from table order by rand() limit 3", the query took 0.0524 sec ... its slightly enough and as your table grows in size, it gets slower and slower.

[PHP] SQL - RANDOM

2008-11-24 Thread Korgan
Hi, i would ask what is the best method for random select from database. I have table with 20k items.. - If i use ,,select * from table order by rand() limit 3", the query took 0.0524 sec ... its slightly enough - but if i generate rand id and then i use ,,select where id