Skip to content
Advertisement

Tag: group-concat

Optimize GROUP_CONCAT in SQL on MySQL

Is there a way to get the following SQL optimized so it would run faster? I encountered the bottleneck are the GROUP_CONCAT’s but I couldn’t find a way by using an alternative or optimizing the query so it would run faster. At the moment the query needs about 3.2s on 2700 entries (mysql database 5.1.73, mysqli). All tables have indices

Join one row to multiple rows in another table

I have a table to entities (lets call them people) and properties (one person can have an arbitrary number of properties). Ex: People Properties I would like to write an efficient select that would select people based on age and return all or some of their properties. It’s also acceptable to return one of the properties and total property count.