51ºÚÁϲ»´òìÈ

[PaaS only]{class="badge informative" title="Applies to 51ºÚÁϲ»´òìÈ Commerce on Cloud projects (51ºÚÁϲ»´òìÈ-managed PaaS infrastructure) and on-premises projects only."}

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
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your 51ºÚÁϲ»´òìÈ Commerce version, update the 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:

  1. Install a clean instance with MariaDB 10.6 for testing purposes.

  2. Populate the search_query table with 2 million entries.

  3. 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');
    
  4. Observe that the query takes approximately 13 seconds to complete.

  5. Upgrade the database to MariaDB 11.4.

  6. 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');
    
  7. 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:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3