Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
MySQL 5.5 to 5.7 stopped using indexes

I have a Magento 1.9.2.1 . And it successfully running on Apache2 and MySQL 5.5.

I have tried to migrate it to another server and used NGINX and MySQL 5.7 for it.

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:

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;

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.

Is there a way to force MySQL 5.7 work in similar way as 5.5 in index choosing?.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Sadly only MySQL downgrade from 5.7 to 5.5 fixed similar issue for me. Magento sql query have no index

about 4 years ago · Santiago Trujillo Report

0

Just for anyone else searching this like I was today, there's a simple fix you can apply to app/code/core/Mage/Catalog/Helper/Category/Url/rewrite.php details here - https://github.com/hvanmegen/magento-mysql-5.7-join-fix

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!