24

While doing bit research for speed issue of magento website i got some links where people says enable "Flat Catalog" to increase performance and speed .

Issue is that why it is not enabled by default is speed is issue.

Will enable "Flat Catalog" had some adverse effect also?

My magento website had 100 products and 500 bundled products and speed is quite issue as i am loading 36 products at once.

Will enabling "Flat Catalog" address my problem?

35

Difference between EAV catalog and Flat catalog is as following:

1. Eav Catalog

EAV is entity attribute value database model, where data is fully in normalized form. Each column data value is stored in their respective data type table. Example, for a product,

product ID is stored in catalog_product_entity_int table,

product name in catalog_product_entity_varchar table,

product price in catalog_product_entity_decimal table,

product created date in catalog_product_entity_datetime table,

product description in catalog_product_entity_text table.

EAV is complex as it joins 5-6 tables even if you want to get just one product’s details.

Columns are called attributes in EAV.

2. Flat Catalog

Flat model uses just one table, so it’s not normalized and uses more database space. It clears the EAV overhead,

It’s good when comes to performance, as it will only require one query to load whole product instead of joining 5-6 tables to get just one product’s details.

Columns are called fields in flat model.

Magento implemented indexers which will periodically query the standard collections and populate flat database tables in following format. Where * is store id.

catalog_category_flat_store_*
catalog_product_flat_*

These tables have non-normalized product and category data that’s intended to be read only. This allows Magento to fetch category and product data in a single query.


You can enable flat catalog by navigating to System > Configuration > Catalog > Frontend > Use Flat Catalog Category | Use Flat Catalog Product. Set this to yes.

If you are adding new attribute in EAV table for catalog. Then don't forget to run re-indexing (System > Configuration > Index Management). Re-indexing refreshes your flat catalog tables.

For more information please check “EAV” & “Flat Catalog” in Magento

  • ok 1: can i switch between flat to eav and eav to flat anytime ? 2: can dynamic columns be added when using flat also ? – mdeveloper Mar 9 '16 at 6:32
  • Yes, You can switch between them. You can also add dynamic columns. But make sure you run re-indexing after adding new attribute to EAV – Rohit Kundale Mar 9 '16 at 6:34
  • @RohitKundale: Enabling Flat Catalog for product missing many attributes and as a result, I am not getting many features displayed for products. I re-indexed also. Why all the attributes are not indexing for dynamic columns while enabling flat catalog? – Anurag Khandelwal Oct 24 '16 at 9:37
  • 2
    @AnuragKhandelwal Check here – Rohit Kundale Oct 27 '16 at 19:33
  • This should have been the first thing they showed me when I started using magento. – Domino Mar 30 '17 at 20:55
5

Magento uses the Entity-Attribute-Value (EAV) model for storing customer, product, and category data in its database. Although the EAV model enables you to have completely extensible attributes for those objects, object attributes are stored in multiple tables rather than one very large table.

Because attributes are stored in many tables—and that includes copies of some of the same attributes—SQL queries can be long and complex. The flat catalog feature creates new tables on the fly, where each row contains all necessary data about a product or category.

In earlier versions of Magento, it was necessary to rebuild the flat catalog every time you made changes to product attributes or product-category associations. In this release, the flat catalog is updated for you—either every minute, or according to your Magento cron job.

Flat catalog options not only enable the flat catalog and flat product indexers but also enable indexing for catalog and shopping cart price rules. If you have a large number of SKUs (500,000 or more), Magento can index catalog and shopping cart price rules quickly if you enable the flat catalog product option.

  • In this release, the flat catalog is updated for you—either every minute, or according to your Magento cron job. which version your are referring – mdeveloper Mar 9 '16 at 6:42
  • Sorry i am not getting your point – Arunendra Mar 9 '16 at 7:22
  • in your option did u refer current version as 1.9. or magento 2 – mdeveloper Mar 9 '16 at 7:28
  • 1
    It's depend on you which version is suitable for you. Magento 2 has more advantage. – Arunendra Mar 9 '16 at 7:56
  • 1
    @Arunendra mdeveloper is asking which version of Magento are you referring to when you say : "In this release, the flat catalog is updated for you". Which release are you talking about? Does Magento 1.9 update it for us? Is it only in Magento 2? In which Magento version did this start getting updated for us? – Olivier Jul 13 '17 at 13:57
1

Flat categories are not automagically upgraded even in Magento 1.9.2. I've not checked 1.9.3, as I always manually rebuild indexes after bulk (eg stock level) updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.