title: MySQL 5.5 to 5.7 stopped using indexes
body: <p>I have a Magento 1.9.2.1 . And it successfully running on Apache2 and MySQL 5.5.</p>
  
  <p>I have tried to migrate it to another server and used NGINX and MySQL 5.7 for it.</p>
  
  <p>But website started to be very slow (12 seconds against 2). 
  After several hours of debug I have found that there is a problem in one query:</p>
  
  <pre><code>SELECT
     `main_table`.`entity_id`,
     `main_table`.`name`,
     `main_table`.`path`,
     `main_table`.`is_active`,
     `main_table`.`is_anchor`,
     `url_rewrite`.`request_path`
  FROM
     `catalog_category_flat_store_1` AS `main_table`
     LEFT JOIN
        `core_url_rewrite` AS `url_rewrite` ON 
        `url_rewrite`.`category_id` = `main_table`.`entity_id` AND
        `url_rewrite`.`is_system` = 1 AND
        `url_rewrite`.`store_id` = 1 AND
        `url_rewrite`.`id_path` LIKE 'category/%'
  WHERE
     (`main_table`.`include_in_menu` = '1') AND
     (`main_table`.`is_active` = '1') AND
     (`main_table`.`path` like '1/2/%')
  ORDER BY
     `main_table`.`position` ASC;
  </code></pre>
  
  <p>And on explain I have found that there is no index used. On the old MySQL 5.5 server explain command showing index in use. Once I force usage of index - new server answers in 0.01s instead of 10s. But I think that it is not good idea to change sourcefiles of magento code.</p>
  
  <p>Is there a way to force MySQL 5.7 work in similar way as 5.5 in index choosing?.</p>