ACSD-68040: Frontend search page slows down on MariaDB 10.6 with large history
The ACSD-68040 patch fixes the issue where the frontend search page experiences significant performance degradation when running on MariaDB 10.6 with a large volume of historical search requests. This patch is available when the Quality Patches Tool (QPT) 1.1.72 is installed. The patch ID is ACSD-68040.
Affected products and versions
The patch is created for 51ºÚÁϲ»´òìÈ Commerce version:
- 51ºÚÁϲ»´òìÈ Commerce (all deployment methods) 2.4.6-p12
 
Compatible with 51ºÚÁϲ»´òìÈ Commerce versions:
- 51ºÚÁϲ»´òìÈ Commerce (all deployment methods) 2.4.4 - 2.4.6-p12
 
magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
The frontend search page slows significantly on MariaDB 10.6 when processing a high volume of historical search requests. A query on the search_query table takes up to 13 seconds on MariaDB 10.6, compared to under 0.5 seconds on MariaDB 11.4.
Steps to reproduce:
- 
                  
Install a clean instance with MariaDB 10.6 for testing purposes.
 - 
                  
Populate the
search_querytable with 2 million entries. - 
                  
Execute the following SQL query:
code language-none SELECT COUNT(*) FROM ( SELECT `main_table`.`query_text` FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (1)) AND (main_table.num_results > 0) ORDER BY `main_table`.`popularity` DESC LIMIT 100 ) AS `result` WHERE (result.query_text = 'seed_q_0000009'); - 
                  
Observe that the query takes approximately 13 seconds to complete.
 - 
                  
Upgrade the database to MariaDB 11.4.
 - 
                  
Re-execute the same SQL query:
code language-none SELECT COUNT(*) FROM ( SELECT `main_table`.`query_text` FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (1)) AND (main_table.num_results > 0) ORDER BY `main_table`.`popularity` DESC LIMIT 100 ) AS `result` WHERE (result.query_text = 'seed_q_0000009'); - 
                  
Observe that the query now completes in approximately 0.4–0.5 seconds.
 
Expected results:
The query or table structure should be optimized to ensure minimal execution time, regardless of the MariaDB version.
Actual results:
The query takes approximately 13–15 seconds on MariaDB 10.6 and 0.4–0.5 seconds on MariaDB 11.4.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- 51ºÚÁϲ»´òìÈ Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
 - 51ºÚÁϲ»´òìÈ Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
 
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide.