0
我有一個真正讓我的VPS陷入困境的mysql查詢。它根據解釋做一個文件擴展。我通常會自己優化查詢,但這個我不確定我知道如何。如何優化這個WordPress的mysql查詢?
SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_posts.*,MAX((1.00 * (MATCH(wp_search_post.post_content) AGAINST ('test' IN BOOLEAN MODE))) + (2.00 * (MATCH(wp_search_post.post_title) AGAINST ('test' IN BOOLEAN MODE))) + (1.00 * (MATCH(wp_search_post.post_excerpt) AGAINST ('test' IN BOOLEAN MODE))) + (1.00 * (MATCH(wp_search_post.post_meta) AGAINST ('test' IN BOOLEAN MODE))) + (2.00 * (MATCH(wp_search_post.post_tags) AGAINST ('test' IN BOOLEAN MODE)))) AS score FROM wp_posts LEFT JOIN wp_search_post ON wp_posts.ID=wp_search_post.post_id WHERE 1=1 AND (wp_posts.post_status='publish' OR wp_posts.post_password='') AND ((MATCH(wp_search_post.post_content,wp_search_post.post_title,wp_search_post.post_excerpt,wp_search_post.post_meta,wp_search_post.post_tags) AGAINST ('test' IN BOOLEAN MODE))) GROUP BY wp_posts.ID HAVING score ORDER BY score DESC,wp_posts.post_date DESC LIMIT 60, 20;
任何幫助,非常感謝。