Answer the question
In order to leave comments, you need to log in
Can GROUP_CONCAT be used for large queries?
Hello. I'm doing a project where I need to retrieve data from a database. The volume depends on the request parameters (set by the user).
The query is grouped by certain columns and to get other values, such as status, I use GROUP_CONCAT.
There can be several thousand statuses in one record. To accommodate all this, I increased the GROUP_CONCAT limit
SET SESSION group_concat_max_len = 1000000;
Question: How can I optimize the query so that it is lighter and without the possibility of breaking. Those. if there are more statuses than 1000000, then the final result will be incorrect.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question