Comments - Data Sampling: Techniques for Efficiently Finding a Random Row

7 years, 5 months ago Rick James

There is no hidden "row number". A UDF can't do better than use the PRIMARY KEY. For MyISAM, the location of a row is the byte offset into the .MYD; there is no list of these to probe. For InnoDB, one should provide a PK; if you don't there is an inaccessible 6-byte number that acts sort of like AUTO_INCREMENT; again, not practical.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.