Skip to content

Commit 4f9a7c9

Browse files
committed
ACP2E-2673: Price partial indexing performance
- reverted to delete statement for empty tables because of Galera cluster locks
1 parent 5f6dfc2 commit 4f9a7c9

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,14 +408,11 @@ function ($type) use ($productsTypes) {
408408
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
409409
$this->tableMaintainer->createMainTmpTable($dimensions);
410410
$temporaryTable = $this->tableMaintainer->getMainTmpTable($dimensions);
411+
$this->_emptyTable($temporaryTable);
411412
$indexer->executeByDimensions($dimensions, \SplFixedArray::fromArray($entityIds, false));
412413
$mainTable = $this->tableMaintainer->getMainTableByDimensions($dimensions);
413414
$this->_insertFromTable($temporaryTable, $mainTable);
414415
$this->deleteOutdatedData($entityIds, $temporaryTable, $mainTable);
415-
// phpcs:ignore Magento2.SQL.RawQuery.FoundRawSql
416-
$this->getConnection()->query(
417-
'TRUNCATE TABLE ' . $this->getConnection()->quoteIdentifier($temporaryTable)
418-
);
419416
}
420417
} else {
421418
// handle 3d-party indexers for backward compatibility

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowsTest.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public function testBatchProcessing()
144144
$adapter = $this->createMock(AdapterInterface::class);
145145
$adapter->method('select')->willReturn($select);
146146
$adapter->method('describeTable')->willReturn([]);
147-
$adapter->expects($this->exactly(4))->method('dropTable');
148147
$this->defaultIndexerResource->method('getConnection')->willReturn($adapter);
149148
$adapter->method('fetchAll')->with($select)->willReturn([]);
150149

@@ -194,21 +193,7 @@ public function testBatchProcessing()
194193
->method('getPrimaryKeyName')
195194
->willReturn('entity_id');
196195

197-
$actionRows = new Rows(
198-
$this->config,
199-
$this->storeManager,
200-
$this->currencyFactory,
201-
$this->localeDate,
202-
$this->dateTime,
203-
$this->catalogProductType,
204-
$this->indexerPriceFactory,
205-
$this->defaultIndexerResource,
206-
$this->tierPriceIndexResource,
207-
$this->dimensionCollectionFactory,
208-
$this->tableMaintainer,
209-
2
210-
);
211-
$actionRows->execute($ids);
196+
$this->actionRows->execute($ids);
212197
}
213198

214199
public function testDeletedProductsBatchProcessing()

0 commit comments

Comments
 (0)