title: Fast mysql query to randomly select N usernames
body: <p>In my jsp application I have a search box that lets user to search for user names in the database. I send an ajax call on each keystroke and fetch 5 random names starting with the entered string. 
  I am using the below query:
  <code> select userid,name,pic from tbl_mst_users where name like 'queryStr%' order by rand() limit 5 </code>
  But this is very slow as I have more than 2000 records in my table.</p>
  
  <p>Is there any better approach which takes less time and let me achieve the same..? I need random values.</p>