Skip to content
Lawsuit Help Desk

Lawsuit News Center

Unmasking the Magento Performance Bottleneck: The Achilles Heel of Search Query Optimization

Unmasking the Magento Performance Bottleneck: The Achilles Heel of Search Query Optimization

Magento e-commerce platform has a significant performance issue in the 2.3.0 and subsequent versions due to the "Popular Search Term Cache" feature. This CPU-intensive search query, specifically "SELECT DISTINCT COUNT(*) FROM search_query AS main_table WHERE (main_table.store_id = 1) AND (num_results > 0)", increases database CPU load, particularly with a high volume of records in the search_query table. The issue impacts keyword search and admin panel functions and worsens with over 40 million rows in the table. Remedies include removing the DISTINCT operator from the query, altering the code in Magento_CatalogSearch/Controller/Result/Index, preventing spam search terms, and limiting tracked search terms. This multifaceted solution can improve Magento's performance significantly.

Full article here: https://medium.com/@lawsuithelpdesk/unmasking-the-magento-performance-bottleneck-the-achilles-heel-of-search-query-optimization-8a89e4837779