title: SELECT query taking too long after MySQL upgrade
body: <p>I just updated my MySQL version to 5.7. A SELECT query that has four INNER-JOINS and that previously took around 3 seconds to execute is now taking so long that I can't even keep track of it. A bit of profiling shows that the 'Send Data' part is taking too long. Can someone tell me what is going wrong? Here's some data. Note that the query is still running at this point in time:</p>
  
  <pre><code>    +----------------------+-----------+
      | Status               | Duration  |
      +----------------------+-----------+
      | starting             |  0.001911 |
      | checking permissions |  0.000013 |
      | checking permissions |  0.000003 |
      | checking permissions |  0.000003 |
      | checking permissions |  0.000006 |
      | Opening tables       |  0.000030 |
      | init                 |  0.000406 |
      | System lock          |  0.000018 |
      | optimizing           |  0.000019 |
      | statistics           |  0.000509 |
      | preparing            |  0.000052 |
      | executing            |  0.000004 |
      | Sending data         | 31.881794 |
      | end                  |  0.000021 |
      | query end            |  0.003540 |
      | closing tables       |  0.000032 |
      | freeing items        |  0.000214 |
      | cleaning up          |  0.000028 |
      +----------------------+-----------+
  </code></pre>
  
  <p>Here's the output of EXPLAIN:</p>
  
  <pre><code>+----+-------------+--------------------+------------+------+---------------+------------+---------+-------+---------+----------+----------------------------------------------------+
  | id | select_type | table              | partitions | type | possible_keys | key        | key_len | ref   | rows    | filtered | Extra                                              |
  +----+-------------+--------------------+------------+------+---------------+------------+---------+-------+---------+----------+----------------------------------------------------+
  |  1 | SIMPLE      | movie_data_primary | NULL       | ref  | cinestopId    | cinestopId | 26      | const |       1 |   100.00 | NULL                                               |
  |  1 | SIMPLE      | mg                 | NULL       | ALL  | NULL          | NULL       | NULL    | NULL  |  387498 |    10.00 | Using where; Using join buffer (Block Nested Loop) |
  |  1 | SIMPLE      | crw                | NULL       | ALL  | NULL          | NULL       | NULL    | NULL  | 1383452 |    10.00 | Using where; Using join buffer (Block Nested Loop) |
  |  1 | SIMPLE      | cst                | NULL       | ALL  | NULL          | NULL       | NULL    | NULL  | 2184556 |    10.00 | Using where; Using join buffer (Block Nested Loop) |
  +----+-------------+--------------------+------------+------+---------------+------------+---------+-------+---------+----------+----------------------------------------------------+
  </code></pre>