TIL; MySQL group_concat length

MySQL group_concat has a max length of 1024. I never new this because I'm never had one get even near this limit. Luckily some client work enlightened me to this. ;)

This limit can be changed in 2 ways:

An "in demand" way would be to run this right before the query:

SET SESSION group_concat_max_len = 2048

However, if you can just live with this limit being higher you can set this in the config as well (thanks @dohpaz42):


I am not aware of the performance ramifications (if any) so just keep that in mind. My gut tells me there isn't much of a hit except for when the query itself is run. If it is a persistent issue, I would think about taking another look at the query and changing up the approach.