MySQL Forums
Forum List  »  Newbie

Re: MySQL is eating all the CPU 100% - Guide me to fix this please
Posted by: Mahesh Kumar
Date: October 23, 2017 10:56AM

I found it. I missed the table name during join.

MariaDB [quiz]> explain SELECT `questions`.`id`, `questions`.`question_direct`, `questions`.`question_user`, `questions`.`quiz_id`, GROUP_CONCAT(choices.id) as choice_id_array, GROUP_CONCAT(choices.choice) as choice_array, GROUP_CONCAT(choices.points) as points_array, GROUP_CONCAT(choices.result_id) as result_array FROM `questions` INNER JOIN `choices` ON `questions`.`id` = `choices`.`question_id` WHERE `quiz_id` = 1 GROUP BY `questions`.`id` ORDER BY RAND();
+------+-------------+-----------+------+---------------+-------------+---------+-------------------+------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-----------+------+---------------+-------------+---------+-------------------+------+----------------------------------------------+
| 1 | SIMPLE | questions | ALL | PRIMARY | NULL | NULL | NULL | 88 | Using where; Using temporary; Using filesort |
| 1 | SIMPLE | choices | ref | question_id | question_id | 4 | quiz.questions.id | 5 | |
+------+-------------+-----------+------+---------------+-------------+---------+-------------------+------+----------------------------------------------+
2 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Written By
Posted
November 07, 2017 09:51AM
Re: MySQL is eating all the CPU 100% - Guide me to fix this please
October 23, 2017 10:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.