Check out this code: https://github.com/oldmoe/mysqlplus/blob/master/ext/mysql.c#L1363
This is really useful for picking out random results on -huge- queries, and helps to get around the RAND() slowdown problems. You could implement a result[rand(result.count)] and not have to pull down an entire pile of records into ruby.
I'm working on a piece of code to allow people to utilize this easily using mysqlplus.. but I'd love to be able to do it in mysql2 instead :-)
This reference changed: https://github.com/oldmoe/mysqlplus/blob/master/ext/mysql.c#L1390
Basically, it's the data_seek(offset) function. It's very useful! Would be really nice to be able to use it.
This function: http://dev.mysql.com/doc/refman/5.0/en/mysql-data-seek.html
Sounds good to me. I'll look at adding this after 0.3.12 (or closing with a reason it cannot be done).
I had a thought about this: what if we implement it as an operator overload on array access (the  operator) on the result set? Then you could do this:
result = connection.query("BIG QUERY")
thing = result
Feature request #130: add element reference operator # to Mysql2::R…
…esult using mysql_data_seek.
@sodabrew will be this merged?
Not until we open a merge window for the next major release.