MariaDB select with group_concat() -内存不足



我们有安装了mariadb的centos 7机器

当我运行:

SELECT h.id,
h.name,
group_concat(distinct d.name ORDER BY d.name SEPARATOR " ") AS descriptions 
FROM inventar h 
LEFT JOIN descriptions d ON(FIND_IN_SET(d.id, h.description_id) > 0) GROUP BY h.id,h.description_id 
ORDER BY h.name asc;

ERROR 5 (HY000): Out of memory (Needed 65535816 bytes)

我读到它可能限制了临时表的大小。

我检查了尺寸:

MariaDB [wexac_hosts]比;显示像"%table_size%"

这样的变量
tbody> <<tr>
Variable_nameValue
max_heap_table_size1048576000
tmp_disk_table_size18446744073709551615
tmp_memory_table_size12572426240
tmp_table_size12572426240

如果GROUP_CONCAT内存不足,则需要增加group_concat_max_len的内存。

来自GROUP_CONCAT文档:

返回的最大字节长度由group_concat_max_len服务器系统变量,默认为1M (>=MariaDB 10.2.4)或1K (<= MariaDB 10.2.3).

最新更新