Skip to content

Commit d107b7f

Browse files
MAGETWO-69130: Non effective query for catalog search & layered navigation
1 parent 3f41511 commit d107b7f

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(
2424
}
2525

2626
/**
27-
* @param $idxTable
27+
* @param string $idxTable
2828
* @return Select
2929
*/
3030
public function buildSelect($idxTable)

app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,13 @@ public function execute($ids = null)
169169
* Delete all records from index table
170170
* Used to clean table before re-indexation
171171
*
172+
* @param array $indexers
172173
* @return void
173174
*/
174175
private function cleanIndexersTables(array $indexers)
175176
{
176177
$tables = array_map(
177-
function(StockInterface $indexer) {
178+
function (StockInterface $indexer) {
178179
return $this->activeTableSwitcher->getAdditionalTableName($indexer->getMainTable());
179180
},
180181
$indexers

app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/FullTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public function testExecuteWithAdapterErrorThrowsException()
2424
$productTypeMock = $this->getMock(\Magento\Catalog\Model\Product\Type::class, [], [], '', false);
2525
$connectionMock = $this->getMock(\Magento\Framework\DB\Adapter\AdapterInterface::class);
2626

27+
$productTypeMock
28+
->method('getTypesByPriority')
29+
->willReturn([]);
30+
2731
$exceptionMessage = 'exception message';
2832

2933
$resourceMock->expects($this->any())

app/code/Magento/CatalogSearch/Model/Search/FilterMapper/ExclusionStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private function applyCategoryFilter(
108108
\Magento\Framework\DB\Select $select
109109
) {
110110
$alias = $this->aliasResolver->getAlias($filter);
111-
$tableName = $this->resourceConnection->getTableName('catalog_category_product_index');;
111+
$tableName = $this->resourceConnection->getTableName('catalog_category_product_index');
112112
$mainTableAlias = $this->extractTableAliasFromSelect($select);
113113

114114
$select->joinInner(

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private function getExpectedSelectForGeneralFilter($withOutOfStock)
170170
['some_index' => 'some_table'],
171171
['entity_id' => 'entity_id']
172172
)->joinInner(
173-
['stock_index' => $this->resource->getTableName('catalog_product_index_eav')],
173+
['stock_index' => $this->resource->getTableName('cataloginventory_stock_status')],
174174
$this->conditionManager->combineQueries(
175175
[
176176
'stock_index.product_id = some_index.entity_id',
@@ -208,7 +208,7 @@ private function getExpectedSelectForFullFilter($withOutOfStock)
208208
{
209209
$select = $this->getExpectedSelectForGeneralFilter($withOutOfStock);
210210
$select->joinInner(
211-
['sub_products_stock_index' => $this->resource->getTableName('catalog_product_index_eav')],
211+
['sub_products_stock_index' => $this->resource->getTableName('cataloginventory_stock_status')],
212212
$this->conditionManager->combineQueries(
213213
[
214214
'sub_products_stock_index.product_id = some_index.source_id',

0 commit comments

Comments
 (0)