Difference Between Index catalog_category_product and catalog_product_category in Magento2

indexmagento2

Could someone explain me what is the difference between the indexes catalog_category_product and catalog_product_category?

From db i see that catalog_category_product is related to table catalog_category_product_index, but i don't find to which table is related catalog_product_category index.

Best Answer

Looking deep in magento core files, you notice that catalog_product_category index model is Magento\Catalog\Model\Indexer\Product\Category that extends Magento\Catalog\Model\Indexer\Category\Product that is the model of catalog_category_product index.

Both of them $fullActionFactory and $rowsActionFactory entities extends from Magento\Catalog\Model\Indexer\Category\Product\AbstractAction that has

const MAIN_INDEX_TABLE = 'catalog_category_product_index';

So we can say that both indexer works and save data on the same table catalog_category_product_index.

Related Topic