Skip to content
Lawsuit Help Desk

Lawsuit News Center

Title: Cracking the Code: How Removing 'DISTINCT' Operators Can Drastically Improve Magento Search Performance

Title: Cracking the Code: How Removing ‘DISTINCT’ Operators Can Drastically Improve Magento Search Performance

Magento 2.4's search function has been encumbered by deteriorating performance due to excessive CPU load. Key culprits of this issue are the 'DISTINCT' operator used to eliminate duplicate rows in search queries, and the 'num_results > 0' condition. These elements cause significant processing delays, especially in larger 'search_query' tables, as showcased by a site with 2.7 million search terms. Possible remedies include removing the 'DISTINCT' operator, re-evaluating the 'num_results > 0' condition, indexing the 'search_query' table or employing ElasticSearch for such tasks. Thorough testing is recommended to mitigate potential risks. The ultimate objective is to improve Magento's search performance, ensuring an optimized platform.

Full article here: https://medium.com/@lawsuithelpdesk/title-cracking-the-code-how-removing-distinct-operators-can-drastically-improve-magento-search-8fae62a288d7