所以我有一个复杂的 MySQL 搜索查询,我想知道我需要索引哪些列来加快搜索速度:
SELECT wpp.ID, post_title, wp_terms.name AS category, wp_terms.slug AS slug, supplier_company,
GROUP_CONCAT(wp_terms.slug SEPARATOR ', ') AS allslug,
GROUP_CONCAT(wp_terms.name SEPARATOR ', ') AS allcatname
FROM wp_posts AS wpp
LEFT JOIN wp_term_relationships ON wpp.ID = object_id
LEFT JOIN wp_terms ON term_taxonomy_id = wp_terms.term_id
LEFT JOIN wp_teleapo_supplier AS s ON wpp.post_author = s.ID
WHERE post_type = 'post'
GROUP BY wpp.ID
1)如何加快group_concat?2)我应该在我的 s
索引列吗?像:和?ON
LEFT JOIN
wpp.ID
object_id