Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // chooses a set of random ids. This set does not contain a fixed number of elements but they are around 20
- $params = ['n' => $num_records, 'c' => $count, 'dc' => ($count * 2 < 20) ? 20 : $count * 2];
- $results = DB::connection('mysql.huge_table')->select('SELECT id FROM atoms_in_universe WHERE RAND() * :n < :dc ORDER BY RAND() LIMIT 0,:c', $params);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement