Category Archives: Optimization

… ORDER BY RAND()

Goal: get random record from database Lets sat we have table `lyric` ~ 33k records, `id` is primary key Simple: SELECT * FROM `lyric` ORDER BY RAND() LIMIT 1; 1 row in set (1.12 sec) wtf!? 1 second ? Note: … Continue reading

Posted in MySQL, Optimization, Optimization, php | Leave a comment