Skip to content
Lawsuit Help Desk

Lawsuit News Center

Dismantling the Distinct Operator: An Inside Look at Magento 2.3's Performance Pitfall and How to Overcome It

Dismantling the Distinct Operator: An Inside Look at Magento 2.3’s Performance Pitfall and How to Overcome It

Magento 2.3, a major e-commerce platform, has performance concerns due to excessive use of the DISTINCT operator in its Popular Search Term Cache feature. This SQL operator has increased CPU usage and delay in query execution, impacting user experience. The issue is the query SELECT DISTINCT COUNT(*) FROM search_query, unnecessarily utilized due to a unique constraint on the query_text and store_id. Inclusion of the clause num_results > 0 aggravates the situation. Proposed resolutions are removing this clause and DISTINCT operator, overriding the execute function, and adding an index to the search_query table. Future development of Magento should consider these findings for improved efficiency.

Full article here: https://ipllfirm.com/all-insights/news-and-articles/dismantling-the-distinct-operator-an-inside-look-at-magento-2-3s-performance-pitfall-and-how-to-overcome-it/