Skip to content

Commit 5483b69

Browse files
committed
AC-13358: RestApi request '/rest/default/V1/categories?searchCriteria%5Bpage_size%5D=1' fails with timeout error
Fix test failures (Static, WebAPI & Integration)
1 parent c814c00 commit 5483b69

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

app/code/Magento/Catalog/Plugin/CategoryManagementPerformanceOptimizer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class CategoryManagementPerformanceOptimizer
2424
* @param int|null $rootCategoryId
2525
* @param int|null $depth
2626
* @return array
27+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2728
*/
2829
public function beforeGetTree(
2930
CategoryManagementInterface $subject,

app/code/Magento/Catalog/etc/db_schema.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
<column name="path"/>
287287
</index>
288288
<!-- Performance optimization index for efficient tree traversal -->
289-
<index referenceId="CATALOG_CATEGORY_ENTITY_PARENT_LEVEL_POSITION" indexType="btree">
289+
<index referenceId="CATALOG_CATEGORY_ENTITY_PARENT_ID_LEVEL_POSITION" indexType="btree">
290290
<column name="parent_id"/>
291291
<column name="level"/>
292292
<column name="position"/>
@@ -408,7 +408,7 @@
408408
<column name="store_id"/>
409409
</index>
410410
<!-- Performance optimization index for is_active attribute filtering -->
411-
<index referenceId="CATALOG_CATEGORY_ENTITY_INT_STORE_ACTIVE" indexType="btree">
411+
<index referenceId="CATALOG_CATEGORY_ENTITY_INT_STORE_ID_VALUE" indexType="btree">
412412
<column name="store_id"/>
413413
<column name="value"/>
414414
</index>
@@ -518,7 +518,7 @@
518518
<column name="product_id"/>
519519
</index>
520520
<!-- Performance optimization index for product count queries -->
521-
<index referenceId="CATALOG_CATEGORY_PRODUCT_CATEGORY_PRODUCT_COVERING" indexType="btree">
521+
<index referenceId="CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID_POSITION" indexType="btree">
522522
<column name="category_id"/>
523523
<column name="product_id"/>
524524
<column name="position"/>

app/code/Magento/Catalog/etc/db_schema_whitelist.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"index": {
159159
"CATALOG_CATEGORY_ENTITY_LEVEL": true,
160160
"CATALOG_CATEGORY_ENTITY_PATH": true,
161-
"CATALOG_CATEGORY_ENTITY_PARENT_LEVEL_POSITION": true
161+
"CATALOG_CATEGORY_ENTITY_PARENT_ID_LEVEL_POSITION": true
162162
},
163163
"constraint": {
164164
"PRIMARY": true
@@ -218,7 +218,7 @@
218218
"CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID": true,
219219
"CATALOG_CATEGORY_ENTITY_INT_ATTRIBUTE_ID": true,
220220
"CATALOG_CATEGORY_ENTITY_INT_STORE_ID": true,
221-
"CATALOG_CATEGORY_ENTITY_INT_STORE_ACTIVE": true
221+
"CATALOG_CATEGORY_ENTITY_INT_STORE_ID_VALUE": true
222222
},
223223
"constraint": {
224224
"PRIMARY": true,
@@ -279,7 +279,7 @@
279279
},
280280
"index": {
281281
"CATALOG_CATEGORY_PRODUCT_PRODUCT_ID": true,
282-
"CATALOG_CATEGORY_PRODUCT_CATEGORY_PRODUCT_COVERING": true
282+
"CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID_POSITION": true
283283
},
284284
"constraint": {
285285
"PRIMARY": true,

dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryManagementTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
33
*
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2015 Adobe
5+
* All rights reserved.
66
*/
77

88
namespace Magento\Catalog\Api;
@@ -96,7 +96,7 @@ public static function treeDataProvider(): array
9696
],
9797
[
9898
2,
99-
null,
99+
3,
100100
[
101101
'id' => 2,
102102
'name' => 'Default Category',
@@ -125,7 +125,7 @@ public static function treeDataProvider(): array
125125
],
126126
[
127127
400,
128-
1,
128+
null, // Default depth is 1
129129
[
130130
'id' => 400,
131131
'name' => 'Category 1',

0 commit comments

Comments
 (0)