Skip to content

Commit bf07aeb

Browse files
author
Stanislav Idolov
committed
MAGETWO-64187: Batch size algorithm
1 parent 8d91105 commit bf07aeb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRowSizeEstimator.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ class CompositeProductRowSizeEstimator implements \Magento\Framework\Indexer\Ind
1414
private $indexTableRowSizeEstimator;
1515

1616
/**
17-
* @var \Magento\Framework\App\ResourceConnection
17+
* @var \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
1818
*/
19-
private $resourceConnection;
19+
private $indexerResource;
2020

2121
/**
22-
* @param \Magento\Framework\App\ResourceConnection $resourceConnection
22+
* @param DefaultPrice $indexerResource
2323
* @param \Magento\Indexer\Model\IndexTableRowSizeEstimator $indexTableRowSizeEstimator
2424
*/
2525
public function __construct(
26-
\Magento\Framework\App\ResourceConnection $resourceConnection,
26+
\Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice $indexerResource,
2727
\Magento\Indexer\Model\IndexTableRowSizeEstimator $indexTableRowSizeEstimator
2828
) {
29-
$this->resourceConnection = $resourceConnection;
29+
$this->indexerResource = $indexerResource;
3030
$this->indexTableRowSizeEstimator = $indexTableRowSizeEstimator;
3131
}
3232

@@ -37,10 +37,10 @@ public function __construct(
3737
*/
3838
public function estimateRowSize()
3939
{
40-
$connection = $this->resourceConnection->getConnection();
40+
$connection = $this->indexerResource->getConnection();
4141
$relationSelect = $connection->select();
4242
$relationSelect->from(
43-
['relation' => $connection->getTableName('catalog_product_relation')],
43+
['relation' => $this->indexerResource->getTable('catalog_product_relation')],
4444
['count' => new \Zend_Db_Expr('count(relation.child_id)')]
4545
);
4646
$relationSelect->group('parent_id');

0 commit comments

Comments
 (0)