|
目前wordpress的post数量超过了100万,首页加载得非常慢,打开SQL语句列表发现是下面语句引起的
[0] => Array
(
[0] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID 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] => 111.10808086395
[2] => require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
)
网上搜索到的解决办法是把no_found_rows参数设置成true就可以解决了,但没有更具体的操作步骤,小白一枚,请教no_found_rows在哪个php文件里面的?(在wp-blog-header.php里面完全找不到)要怎么修改才能解决SQL_CALC_FOUND_ROWS慢的问题? |
|