MySQL Forums
Forum List  »  Newbie

Re: EXPLAIN shows optimized query
Posted by: Mahesh Kumar
Date: November 01, 2017 01:19PM

Sir,

Not using Myisam. I tried to check whether MYISAM and INNODB provide same results for explain.

| question_multilingual | CREATE TABLE `question_multilingual` (
  `question_multilingual_id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `FK_question_id` int(5) unsigned NOT NULL,
  `FK_language_id` smallint(3) unsigned NOT NULL,
  `question_text` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`question_multilingual_id`),
  UNIQUE KEY `FK_question_id` (`FK_question_id`,`FK_language_id`)
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |

| questions | CREATE TABLE `questions` (
  `question_id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `FK_quiz_id` int(5) unsigned NOT NULL,
  `question_identify_text` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`question_id`),
  KEY `FK_quiz_id` (`FK_quiz_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |

---+----------+----------------------------------------------+
| id | select_type | table                 | partitions | type   | possible_keys          | key            | key_len | ref                                          | rows | filtered | Extra                                        |
+----+-------------+-----------------------+------------+--------+------------------------+----------------+---------+----------------------------------------------+------+----------+----------------------------------------------+
|  1 | SIMPLE      | question_multilingual | NULL       | ALL    | FK_question_id         | NULL           | NULL    | NULL                                         |   84 |    10.00 | Using where; Using temporary; Using filesort |
|  1 | SIMPLE      | questions             | NULL       | eq_ref | PRIMARY,FK_quiz_id     | PRIMARY        | 4       | quizzes.question_multilingual.FK_question_id |    1 |   100.00 | Using where                                  |
|  1 | SIMPLE      | choices               | NULL       | ref    | PRIMARY,FK_question_id | FK_question_id | 4       | quizzes.question_multilingual.FK_question_id |    6 |   100.00 | Using index                                  |
|  1 | SIMPLE      | choice_multilingual   | NULL       | eq_ref | FK_choice_id           | FK_choice_id   | 6       | quizzes.choices.choice_id,const              |    1 |   100.00 | NULL                                         |

I am getting the same result

Options: ReplyQuote


Subject
Written By
Posted
October 31, 2017 03:11AM
Re: EXPLAIN shows optimized query
November 01, 2017 01:19PM


Sorry, only registered users may post in this forum.

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.