0

Greetings forum members,

I hope this message finds you well. I am currently facing an issue with my Magento 2 production database and would greatly appreciate any insights or assistance from the community. Specifically, I am curious to know if anyone else has encountered SQL queries involving the 'EXPLAIN' command in their Magento 2 production database.

Recently, our DBA team notified me about the presence of a query, "EXPLAIN 'quote'," running on our database. It's worth noting that I do not have any modules or extensions installed in my Magento 2 instance that would generate such queries.

If anyone has come across similar situations involving unexplained 'EXPLAIN' queries in their Magento 2 production databases, I would greatly appreciate hearing about your experiences. Furthermore, I would be grateful for any suggestions, recommendations, or potential solutions you may have for addressing this issue.

I want to emphasize that I am open to any insights, as this matter is causing concerns about the performance of our Magento 2 setup. Your expertise and input would be immensely valuable in helping me identify and resolve this issue.

Thank you all for your time and support. I eagerly await your responses and guidance.

2 Answers 2

0

Firstly, if your site uses MySQL, this query has a syntax error as the quote table name should be wrapped inside backticks ` instead of single quotes '.

Even if it is a correct query, it will not harm your site, as it only describes the quote database table.

EXPLAIN `quote`

It is possible that this query was executed directly in the database by someone for debugging purposes or related reasons, rather than being called from within the code.

You can also run the following command within the Magento root directory to verify that there is no code responsible for executing that query:

grep -r EXPLAIN .
2
  • I executed the command 'grep -r EXPLAIN . ' however, only files referring to phpStan appeared.
    – Magenteiro
    May 29, 2023 at 19:17
  • That means there is no code responsible for executing “EXPLAIN quote” SQL query in your code!
    – Tu Van
    May 30, 2023 at 4:13
0

You should test your code on a local environment if any of your 3rd party installed plugins are triggering these explain queries.

you can install https://github.com/mirasvit/module-profiler extension wherein u will get details of all the queries running on a particular request or page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.