0

NOTE : Yes! there are number of related questions to this.But I have unique approach which is not mentioned in any other post and I want to know if it is fast.

So all other questions have accepted answer as below

SELECT * FROM catalogue order by RAND() LIMIT 5

But I heard it is too slow for large table.So I want to know if below approach is faster than above code.

//I know my row count.500k
<?php
$rand = rand(1,499990)
$limit = "$rand , ",$rand+10;

and my query wil be

SELECT * FROM catalogue  LIMIT $limit

where $limit will be like 1,10 , 450,460 etc...

Vishnu
  • 2,372
  • 6
  • 36
  • 58

0 Answers0