As of Magento 2.3 it is no longer best practice to use flat catalog at all.
Detailed info and justification for this is a little thin on the ground right now (updates should be made to answers here to reflect when more info is found.) Apparently, this is specifically for performance reasons. As this question is related to performance, this is relevant.
You have to have created a module to show a current category on the product page. Check below files
If you want to get the current product category id then use below code
NOTE: Please do not use the Object manager
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create('Magento\Catalog\Block\Product\View')->getProduct();
$categoryId = $product->getCategoryId();
$category = $objectManager-&...
I saw this happen when a group by statement is added to the product collection.
If this is the case, you can create an after plugin for the product collection that looks like this
public function afterGetSelectCountSql(
You should delete all the rows which have store # 0 in the table catalog_category_entity_int, catalog_category_entity_varchar, catalog_category_entity_text, catalog_category_entity_decimal, catalog_category_entity_datetime