タグ

ブックマーク / jan.kneschke.de (1)

  • ORDER BY RAND()

    If you read the MySQL manual you might have seen the ORDER BY RAND() to randomize the the rows and using the LIMIT 1 to just take one of the rows. This example works fine and is fast if you only when let's say 1000 rows. As soon as you have 10000 rows the overhead for sorting the rows becomes important. Don't forget: we only sort to throw nearly all the rows away. I never liked it. And there are b

    jkltf
    jkltf 2014/02/19
  • 1