27 votes
Accepted

Magento 2: Are Flat Tables Still a Thing?

Yes, flat tables are still a thing. You can enable flat tables for products and categories from stores->configuration->catalog->storefront. Why do we need flat tables? They do offer significant ...
Abhishek Jakhotiya's user avatar
11 votes
Accepted

Force products collection to use EAV instead of flat table

The object which is responsible to determine if flat index is available (class Magento\Catalog\Model\Indexer\Product\Flat\State) is an immutable shared instance. But it is possible to use our own ...
Fabian Schmengler's user avatar
8 votes

Magento 2: Are Flat Tables Still a Thing?

Based on magento documentation for flat table mentioned in https://docs.magento.com/m2/ce/user_guide/catalog/catalog-flat.html Starting with Magento 2.3.0+, the use of a flat catalog is no longer a ...
Sarjan Gautam's user avatar
6 votes

Magento 2: Using a Flat Catalog is Helpful for Performance?

There are 2 data models in magento: eav (default) and flat. EAV is a very angile model it allows user to add custom attributes as many is he likes, but the problem is that it stores the data in many ...
Moshe Shperling's user avatar
6 votes

Force products collection to use EAV instead of flat table

When a product collection is loaded, the fact that it uses EAV or flat tables is determined by this result \Magento\Catalog\Model\ResourceModel\Product\Collection::isEnabledFlat(). You can write an ...
Marius's user avatar
  • 198k
6 votes
Accepted

How to filter product collection using category id in flat mode

I think Below code solve your concern $collection = Mage::getModel('catalog/category') ->load($categoryId) ->getProductCollection(); After that you can ...
Murtuza Zabuawala's user avatar
5 votes

Magento Indexer Not Adding Attribute to flat table in custom attribute

As already told in other answers, you need used_in_product_listing to be set to 1. But as you defined a source model ('source' => 'vendorsproduct/source_approval',), you may need an extra step : ...
Cladiuss's user avatar
  • 1,271
5 votes

Magento Indexer Not Adding Attribute to flat table in custom attribute

Another way to add attributes to flat tables is to set them in your config.xml frontend section ... <product> <collection> <attributes> <attribute_code/&...
sv3n's user avatar
  • 11.7k
5 votes

Get child categories tree when Flat Catalog Category is enabled in admin in Magento 2

You can use getChildren to get child category data in your block even Use Flat Catalog Category is enabled. For example namespace Custom\Module\Block\World; class Index extends \Magento\Framework\...
Krishna ijjada's user avatar
3 votes

Magento 2: Using a Flat Catalog is Helpful for Performance?

As of Magento 2.3, it is no longer best practice to use the Flat Catalog feature at all. The primary justfication for this revolves around this official troubleshooting article that recognises ongoing ...
Josh Davenport-Smith's user avatar
3 votes

Magento Indexer Not Adding Attribute to flat table in custom attribute

For me it was enough to set only "used_in_product_listing" => true 'attribute_code' => array( 'type' => 'int', 'input' => 'select', ...
vpodorozh's user avatar
3 votes

How to get rid of Base table or view not found: 1146 Table 'catalog_category_flat_store_1' doesn't exist?

If you are running a store with a very small number of products/categories you may want to simply disable the flat tables in System > Settings > Catalog. This can also sometimes be the case for ...
B00MER's user avatar
  • 8,307
3 votes

Starting with Magento 2.3.0+, the use of a flat catalog is no longer a best practice and is not recommended

Check out the following tweets: The biggest problem here is not EAV or Flat tables, but the indexers. They fail very often and takes lot of time to dump data from EAV to flat tables.— Kalpesh ...
Mathanagopal S's user avatar
3 votes

Does enabling category and product flat data will affect performance in Magento 2?

it will not help in a performance boost in the latest version with Magento plus Magento no longer recommend use flat catalog option for more info https://docs.magento.com/m2/ce/user_guide/catalog/...
Yasir Latif's user avatar
2 votes

How to addFieldToFilter for attribute special_price with flat product tables?

I may be quite late, but you could try using the following: <?php /** @var $collection Mage_Catalog_Model_Resource_Category_Collection */ $collection = Mage::getModel('catalog/category', ...
Insan3's user avatar
  • 23
2 votes

How to filter product collection using category id in flat mode

As an alternative you an get category's product collection as follows - $category = new Mage_Catalog_Model_Category(); $category->load($brandValue['category']); // this is category id $collection =...
InfoBeans's user avatar
  • 332
2 votes
Accepted

Products in catalog_product_flat_1

catalog_category_product is the indexer for category / product relations. The indexer for the flat catalog table is catalog_product_flat. Note that products with the status "Disabled" are not indexed.
Fabian Schmengler's user avatar
2 votes
Accepted

Grey stripe started running through all my images

Check if your backup of the "broken" image has a watermark defined. diff core_config_data against your working table.
Fabian Blechschmidt's user avatar
2 votes

How to filter product collection using category id in flat mode

$collection = Mage::getResourceModel('catalog/product_collection') ->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left') ->addAttributeToFilter('...
Knowband Plugins's user avatar
2 votes

Get child categories tree when Flat Catalog Category is enabled in admin in Magento 2

You have use CategoryRepository for getting all categories with sub-categories. $parentCatId = 1; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $categoryRepository = $...
Chirag Prajapati's user avatar
2 votes
Accepted

Category Flat Data problem: description is missing in flat table without indexing error

Then I thought maybe it was updated in a newer release of Magento CE. I've checked the 1.9.1 and this method hasn't changed. That's (un)fortunately not right. In Magento 1.8.0.0 the mehtod changed ...
sv3n's user avatar
  • 11.7k
2 votes
Accepted

Get sub-categories of parent with flat catalog enabled Magento 2

To get child categories, you can use getChildrenCategories() which will also work with Flat settings. But also note that, if flat is enabled, then you don't need to bring disabled category in ...
Amit Bera's user avatar
  • 77.5k
2 votes

How to get all Products including disabled in Magento 1.3

Try to use this code. You'll get disabled product collection using this code. $collection = Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('*') ->...
Emipro Technologies Pvt. Ltd.'s user avatar
2 votes
Accepted

How to get all Products including disabled in Magento 1.3

Try following way: $newStoreId = Mage_Core_Model_App::ADMIN_STORE_ID; Mage::app()->setCurrentStore(Mage::getModel('core/store')->load($newStoreId)); $productCollection = $category->...
Sohel Rana's user avatar
  • 35.8k
2 votes
Accepted

Magento 2: When use Flat Catalog Product it gives SQL error

You have to rebuild the index. Afterwards it should work. The reason is that your attribute "featured" has been added after the flat index has been rebuilt the last time. The flat index works by ...
simonthesorcerer's user avatar
2 votes
Accepted

out of stock products in flat tables

You can get Out of stock product by changing a setting. For magento2,goto Admin>Stores > Configuration > Catalog > Inventory > Stock Options. Display Out of Stock Products: Choose Yes to enable ...
Amit Bera's user avatar
  • 77.5k
2 votes
Accepted

Rolled back transaction has not been completed correctly while saving product

I have faced similar issue. When I review all the magento and server logs, I found an error which is caused by a product save after observer. Here, the product saved but the observer is trying to do a ...
Shivanand Chary's user avatar
1 vote

Magento 2: Are Flat Tables Still a Thing?

Flat tables not a thing anymore It doesn't add any performance improvements and would be deprecated in next releases
bxN5's user avatar
  • 176
1 vote
Accepted

Description attribute in Flat Catalog Table

If I set description to 'Used in Product Listing' i.e. deliberately put it in flat tables would it affect my site performance or its functioning in any way? To answer your question directly on ...
Raphael at Digital Pianism's user avatar
1 vote

Description attribute in Flat Catalog Table

by default in magento description is not in listing page. and flat table is mostly use for list page only for many website description has large data so that's why its not advisable to add ...
Murtuza Zabuawala's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible