title: quick random row selection in Postgres
body: <p>I have a table in postgres that contains couple of millions  of rows. I have checked on the internet and I found the following </p>
  
  <pre><code>SELECT myid FROM mytable ORDER BY RANDOM() LIMIT 1;
  </code></pre>
  
  <p>It works, but it's really slow... is there another way to make that query, or a direct way to select a random row without reading all the table? By the way 'myid' is an integer but it can be an empty field.</p>