mysql 获取随机数据占用cpu高
解决办法:
优化sql 语句
SELECT * FROM zbp_post AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX(log_ID) FROM zbp_post)-(SELECT MIN(log_ID) FROM zbp_post))+(SELECT MIN(log_ID) FROM zbp_post)) AS myid) AS t2 WHERE t1.log_ID >= t2.myid ORDER BY t1.log_ID LIMIT 10
- 本文固定链接: http://www.ypbj.cc/post/323.html
- 转载请注明: yupang 于 余胖笔记 发表
《本文》有 0 条评论