A MySQL query is running significantly slower since adding a group_concat clause. Currently, this query looks as follows:
select ... group_concat(distinct category.name) .... from page where
left outer join page_category on page.id = page_category.page_id
left outer join category on page_category.category_id = category.id
....
group by page.id
As mentioned in the query, among others, my application has 3 tables: page, category, and page_category. A page can be associated with none or multiple categories. Currently page, page_category, and category have 9,460, 20,241 and 10 entries, respectively.
Can anyone help me to improve this query to improve its performance?