title: Get random records with Doctrine
body: <p>I wonder how to get a random number of Members from a Group, but I do not know what is the best way to do this, and I think <code>ORDER BY RAND()</code> is not the best alternative, as a Group can have more than 100,000 Members, performing this type of query could be very slow.</p>
  
  <p>I found this way to make using SQL, but I do not know how to do the same thing in DQL: <a href="https://stackoverflow.com/questions/1244555/how-can-i-optimize-mysqls-order-by-rand-function/1244588#1244588">How can i optimize MySQL&#39;s ORDER BY RAND() function?</a></p>