Skip to content

Commit 4577c56

Browse files
committed
ACP2E-2033: [Performance issue] Price indexer works slow
- implemented CR
1 parent 5abe5fe commit 4577c56

File tree

1 file changed

+2
-3
lines changed
  • app/code/Magento/Bundle/Model/ResourceModel/Indexer

1 file changed

+2
-3
lines changed

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,6 @@ private function calculateFixedBundleSelectionPrice()
674674
private function calculateDynamicBundleSelectionPrice(array $dimensions): void
675675
{
676676
$connection = $this->getConnection();
677-
678677
$price = 'idx.min_price * bs.selection_qty';
679678
$specialExpr = $connection->getCheckSql(
680679
'i.special_price > 0 AND i.special_price < 100',
@@ -716,7 +715,7 @@ private function calculateDynamicBundleSelectionPrice(array $dimensions): void
716715
[]
717716
);
718717
$select->where('si.stock_status = ?', Stock::STOCK_IN_STOCK);
719-
$select = str_replace('AS `idx`', 'AS `idx` USE INDEX (PRIMARY)', $select->__toString());
718+
$query = str_replace('AS `idx`', 'AS `idx` USE INDEX (PRIMARY)', (string) $select);
720719
$insertColumns = [
721720
'entity_id',
722721
'customer_group_id',
@@ -739,7 +738,7 @@ private function calculateDynamicBundleSelectionPrice(array $dimensions): void
739738
$connection->query(sprintf(
740739
"INSERT INTO `" . $this->getBundleSelectionTable() . "` (%s) %s ON DUPLICATE KEY UPDATE %s",
741740
implode(",", $insertColumns),
742-
$select,
741+
$query,
743742
implode(",", $updateValues)
744743
));
745744
}

0 commit comments

Comments
 (0)