Skip to content

Commit 7563129

Browse files
committed
Price Indexer Performance Issue With Out of Stock Products
- Relates to issue #24414
1 parent 72aebb7 commit 7563129

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
104104
$select->where('stock_item.use_config_manage_stock = 0 AND stock_item.manage_stock = 1');
105105
}
106106

107+
if ($entityIds !== null) {
108+
if (count($entityIds) > 1) {
109+
$select->where('stock_item.product_id in (?)', $entityIds);
110+
} else {
111+
$select->where('stock_item.product_id = ?', $entityIds);
112+
}
113+
}
114+
107115
$select->group('stock_item.product_id');
108116
$select->having('max_is_in_stock = 0');
109117

0 commit comments

Comments
 (0)