Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 12 down vote accepted

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.

Hope you understand

share|improve this answer
    
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 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 Mar 9 at 6:34

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.

share|improve this answer
    
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 at 6:42
    
Sorry i am not getting your point – Arunendra Mar 9 at 7:22
    
in your option did u refer current version as 1.9. or magento 2 – mdeveloper Mar 9 at 7:28
    
It's depend on you which version is suitable for you. Magento 2 has more advantage. – Arunendra Mar 9 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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