Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda