August 11th, 2013, 03:12 PM
For an application I collect data from a lot of tables. From most tables I need only a single row. But from some I need several rows and I tend to do that with a group_concat.
So my query looks something like
My problem is that this group_concat is extremely slow. My code becomes much faster when I remove the group_concat() line from the complex query and instead for every single of the 100 lines do a separate query on table_3.
SELECT .. . . . . . . . FROM table_1
Left join table_2 on ..
Left join table_3 on ..
Left Join (Select group_concat(..) AS .. FROM table_3 GROUP BY.. ) .. on ..
So my question is why this is so and whether it is possible to tweak the complex query so that it achieves the same speed.
August 11th, 2013, 03:34 PM
can't tell without seeing your indexes and the EXPLAIN of your query
Originally Posted by musicmouse