ACSD-65848: Categories in admin are loading very slow
The ACSD-65848 patch fixes the issue where the total product count in a category was calculated using a sub-select, which delayed category load time. This patch is available when the Quality Patches Tool (QPT) 1.1.66 is installed. The patch ID is ACSD-65848. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.9.
Affected products and versions
The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.8
Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.8
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 Admin category view/edit page experiences significant delays when loading. The delay is caused by the method used to calculate the total product count in a category, which relies on a sub-select query. Refactoring this logic to use a join instead improves performance and reduces load time.
Steps to reproduce:
-
Create a new ÃÛ¶¹ÊÓÆµ Commerce Cloud instance using version 2.4.8.
-
Create 2,500 categories and at least 10,000 products:
-
Copy the
setup/performance-toolkit
directory to./var
so you can edit the profiles. -
Open the
small.xml
profile and update it to include 2,500 categories and 250,000 products (to match the merchant’s setup). -
Run the following command to generate the fixtures:
code language-bash bin/magento setup:performance:generate-fixtures var/setup/performance-toolkit/profiles/ce/small.xml
-
-
After the products and categories are created, make sure all categories are set as anchors. Run this SQL query:
code language-sql UPDATE catalog_category_entity_int SET value = 1 WHERE attribute_id = ( SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'is_anchor' );
-
In the Admin panel, create a deeper category structure:
- Move Category 2 under Category 1 to nest it deeper in the tree.
-
Try to open a category page in the Admin panel using a URL like:
/admin/catalog/category/edit/id/xx/
Expected results:
Each category page opens on the first try within a few seconds.
Actual results:
Category pages take more than a minute to open.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- ÃÛ¶¹ÊÓÆµ Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- ÃÛ¶¹ÊÓÆµ 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.