I have a table with over 4 million rows.
I want to randomly select one row.
The following works:
but unfortunately it appears to "select" the entire table first, then returns the random row. Consequently this query takes an unacceptably long time.
I need to return a random row more quickly.
I'd like some advice on alternative methods to randomly select from this table.
D.E.R. Management - IT Project Management Consulting
I want to randomly select one row.
The following works:
Code:
select * from items order by rand() limit 1;
I need to return a random row more quickly.
I'd like some advice on alternative methods to randomly select from this table.
D.E.R. Management - IT Project Management Consulting