Skip to content
Lawsuit Help Desk

Lawsuit News Center

Unlocking the Bottleneck: How Trimming Redundancies in Magento's Search Queries Can Drastically Improve Your Site's Performance

Unlocking the Bottleneck: How Trimming Redundancies in Magento’s Search Queries Can Drastically Improve Your Site’s Performance

Magento 2 experienced performance issues due to increased CPU load following an update, with a commonly used search query found to be the main culprit. Despite the introduction of the Popular Search Term Cache and implementation of Elasticsearch, a problematic query continued to drain resources. The DISTINCT operator within the query, SELECT DISTINCT COUNT(*) FROM search_query AS main_table WHERE (main_table.store_id = 1) AND (num_results > 0), unnecessarily added overhead, leading to slow response times. By removing the operator, query execution time was reduced significantly. Although patches have been attempted, the issue remains. Future updates could involve altering the 'isTopSearchResult' function, selectively inserting search terms, disabling search term tracking, or inserting search terms in batches. Eliminating these inefficiencies in Magento's search queries could greatly enhance its performance and user experience.

Full article here: https://ipllfirm.com/all-insights/news-and-articles/unlocking-the-bottleneck-how-trimming-redundancies-in-magentos-search-queries-can-drastically-improve-your-sites-performance/