Mysql慢查询wordpress

时间:2016-05-05 12:05:51

标签: php mysql wordpress wpml

由于查询速度慢,我的托管服务提供商希望暂停网站。他们是:

Time running : 34
Query : 
SELECT SQL_CALC_FOUND_ROWS
    wp_posts.ID
FROM
    wp_posts
        LEFT JOIN
    wp_icl_translations t ON wp_posts.ID = t.element_id
        AND t.element_type LIKE 'post\_%'
        LEFT JOIN
    wp_icl_languages l ON t.language_code = l.code
        AND l.active = 1
WHERE
    1 = 1
        AND (((wp_posts.post_title LIKE '%Europe%')
        OR (wp_posts.post_excerpt LIKE '%Europe%')
        OR (wp_posts.post_content LIKE '%Europe%')))
        AND wp_posts.post_type IN ('post' , 'page',
        'attachment',
        'slides',
        'careers',
        'partners',
        'team',
        'news',
        'casestudies')
        AND (wp_posts.post_status = 'publish'
        OR wp_posts.post_author = 1
        AND wp_posts.post_status = 'private')
        AND (t.language_code = 'en'
        OR t.language_code IS NULL)
ORDER BY wp_posts.post_title LIKE '%Europe%' DESC , wp_posts.post_date DESC
LIMIT 0 , 10

Time running : 50
Query : 
SELECT SQL_CALC_FOUND_ROWS
    wp_posts.ID
FROM
    wp_posts
        LEFT JOIN
    wp_icl_translations t ON wp_posts.ID = t.element_id
        AND t.element_type LIKE 'post\_%'
        LEFT JOIN
    wp_icl_languages l ON t.language_code = l.code
        AND l.active = 1
WHERE
    1 = 1
        AND (((wp_posts.post_title LIKE '%1%')
        OR (wp_posts.post_excerpt LIKE '%1%')
        OR (wp_posts.post_content LIKE '%1%')))
        AND (wp_posts.post_password = '')
        AND wp_posts.post_type IN ('post' , 'page',
        'attachment',
        'slides',
        'careers',
        'partners',
        'team',
        'news',
        'casestudies',
        'privatearea')
        AND (wp_posts.post_status = 'publish')
        AND (t.language_code = 'en'
        OR t.language_code IS NULL)
ORDER BY wp_posts.post_title LIKE '%1%' DESC , wp_posts.post_date DESC
LIMIT 0 , 10

我在网站上使用搜索表单后如何看到此查询已执行,对吧?我该如何解决这个问题? (我也安装了WPML插件)

0 个答案:

没有答案