Skip to content

Commit 7ea2238

Browse files
Update TableBuilder.php
Set 'row_id' as primary key because joins are made on it. Without this change product flat reindex can get practically stuck while making insert-from-select query in Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder::_fillTemporaryFlatTable.
1 parent f4c95fc commit 7ea2238

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ public function build($storeId, $changedIds, $valueFieldSuffix)
101101
$temporaryTableName = $this->_getTemporaryTableName($tableName);
102102

103103
//Add primary key to temporary table for increase speed of joins in future
104-
$this->_addPrimaryKeyToTable($temporaryTableName);
104+
$this->_addPrimaryKeyToTable($temporaryTableName, 'row_id');
105105

106106
//Create temporary table for composite attributes
107107
if (isset($valueTables[$temporaryTableName . $valueFieldSuffix])) {
108-
$this->_addPrimaryKeyToTable($temporaryTableName . $valueFieldSuffix);
108+
$this->_addPrimaryKeyToTable($temporaryTableName . $valueFieldSuffix, 'row_id');
109109
}
110110

111111
//Fill temporary tables with attributes grouped by it type

0 commit comments

Comments
 (0)