wordpress SQL语句优化

龙上 发布于 2012/07/05 23:49
阅读 341
收藏 0
SELECT YEAR(post_date) AS `YEAR`, MONTH(post_date) AS `MONTH`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC

执行时间:1.1779620

SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 10
执行时间:1.41997504	

上面的两条语句还可以优化吗?

附上表结构

加载中
返回顶部
顶部