Data Sampling: Techniques for Efficiently Finding a Random Row
Fetching random rows from a table (beyond ORDER BY RAND())
The problem
Metrics
FLUSH STATUS;
SELECT ...;
SHOW SESSION STATUS LIKE 'Handler%';Case: Consecutive AUTO_INCREMENT without gaps, 1 row returned
Case: Consecutive AUTO_INCREMENT without gaps, 10 rows
Case: AUTO_INCREMENT with gaps, 1 or more rows returned
Case: Extra FLOAT column for randomizing
Case: UUID or MD5 column
See also
Last updated
Was this helpful?

