请问如何解决SQL_CALC_FOUND_ROWS导致wordpress首页加载慢的问题?
目前wordpress的post数量超过了100万,首页加载得非常慢,打开SQL语句列表发现是下面语句引起的=> Array
(
=> SELECT SQL_CALC_FOUND_ROWSwp_posts.ID FROM wp_postsWHERE 1=1AND 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
=> 111.10808086395
=> 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慢的问题? https://flavio.tordini.org/speed-up-wordpress-get_posts-and-query_posts-functions
搜下第一条不就是吗,你都能找出是这里慢了,这点东西还能难住你
static/image/smiley/yct/011.gif
页:
[1]