I’ve a (what it appears to me) easy question which fails to run on a easy desk, the error is:
Out of kind reminiscence, think about growing server kind buffer measurement
These are the SQL statements which I am making an attempt to run:
CREATE TABLE `permissions` ( `id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `title` (`title`) )ENGINE=InnoDB AUTO_INCREMENT=11 CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; INSERT INTO `permissions` (`id`, `title`) VALUES (1,'ocjena_dobavljaca.view'), (2,'ocjena_dobavljaca.edit'), (3,'ocjena_dobavljaca.delete'), (4,'zaposlenici.view'), (5,'zaposlenici.edit'), (6,'zaposlenici.delete'), (7,'vatrogasni_aparati.view'), (8,'vatrogasni_aparati.edit'), (9,'vatrogasni_aparati.delete'), (10,'organizacijska_shema_drustva'); COMMIT; SELECT SUBSTRING_INDEX(title, '.', 1) as n, COUNT as num, GROUP_CONCAT(title)as nn FROM permissions GROUP BY n
You’ll be able to examine it on this SQL Fiddle.
This reply states:
Whereas elevating sort_buffer_size might help queries queries with GROUP BYs and ORDER BYs, you might be higher off enhancing the queries which you can enhance and including indexes that can be utilized by the Question Optimizer.
however I do not see any manner to enhance the question or add indexes to the desk, as they’re fairly easy.
sort_buffer_size from 64Okay (default) to 256Okay solves the problem, however I am undecided if that is the suitable answer.
The opposite answer is to make the question with a subquery (two
SELECTs), which appears a bit redundant:
SELECT n, COUNT as num, GROUP_CONCAT(title)as nn FROM ( SELECT SUBSTRING_INDEX(title, '.', 1) as n, title FROM permissions) a GROUP BY n;
Can anybody clarify why the error?