Home » Magento

Magento: Describing Flat Catalog

27 November 2009 7,073 views Popularity: 15% Share/Bookmark

email

Difference between EAV and Flat Catalog

In EAV database model, data are stored in different smaller tables rather than storing in a single table.

Like,
product name is stored in catalog_product_entity_varchar table
product id is stored in catalog_product_entity_int table
product price is stored in catalog_product_entity_decimal table

EAV database model is used by Magento for easy upgrade and development as this model gives more flexibility to play with data and attributes.

When flat catalog is enabled in Magento then all the above product attributes (id, name, price) are kept in one table named like catalog_product_flat. Then Magento fetches product data from the flat table rather than joining all the other smaller tables.

There are two types of Flat Catalog:
1) Flat Catalog Product
2) Flat Catalog Category

- Flat Categories are recommended for any Magento installation for improved performance.
- Flat Products is designed and recommended for catalogs that have over 1000 SKU’s.

Enable Flat Catalog Category:

- Go to Admin Panel->System->Cache Management->Rebuild Flat Catalog Category
- Go to Admin Panel->System->Configuration->Catalog->Frontend->Use Flat Catalog Category = Yes

Enable Flat Catalog Product:

- Go to Admin Panel->System->Cache Management->Rebuild Flat Catalog Product
- Go to Admin Panel->System->Configuration->Catalog->Frontend->Use Flat Catalog Product = Yes

Remember that, initially the selection list of

Admin Panel->System->Configuration->Catalog->Frontend->Use Flat Catalog Product
OR,
Admin Panel->System->Configuration->Catalog->Frontend->Use Flat Catalog Product

is non-editable. You have to rebuild Flat Catalog from Cache Management. Only then the selection list becomes editable.

Related posts:

  1. Magento: Reindex Data Programmatically
  2. Magento: Create Catalog Price Rule Programmatically
  3. Magento: How to filter product collection using 2 or more category filters?
  4. Magento: Get category name and url from product
  5. Magento: Adding category attributes
  6. Magento: Product is still visible in catalog and search even after changing visibility to nowhere
  7. Magento: Get sub categories and product count
  8. Magento 1.4: No products displayed in category listing
  9. Magento: Disable Admin Notification Popup
  10. Magento: Block Controller Model Helper Override
  • http://www.kedaisouvenir.com Arata

    Thank you for the explanation.
    Now I can choose which option suit my store’s best.

    -cheers-

  • Eddy

    nice explanation , i search this article for several hours…. TKS..

  • VoltzRo

    thx a lot, good information.

  • C Castrillo

    Hi, that was a good explanation, but I have a question… it might sound silly but I need to know…  Let´s put it as an example to explain myself better:
    - say that you enable the Flat Category and Flat Product options… the Index is built and form now on each of the new products or categories I insert will be store on a single flat table.
    - Suddenly I realize that this option somehow conflicts with some other extension I´m using so I want to go bat to the EAV data model…

    What would it happened with all those modifications I did while using the Flat model? THey have been store on a different way on the database??  Will Magento reindex or build the other Model too?

    I might sound stupid but I would like to have this clear before I go for it…

    Thanx

    Tino

  • C Castrillo

    Hi, that was a good explanation, but I have a question… it might sound silly but I need to know…  Let´s put it as an example to explain myself better:
    - say that you enable the Flat Category and Flat Product options… the Index is built and form now on each of the new products or categories I insert will be store on a single flat table.
    - Suddenly I realize that this option somehow conflicts with some other extension I´m using so I want to go bat to the EAV data model…

    What would it happened with all those modifications I did while using the Flat model? THey have been store on a different way on the database??  Will Magento reindex or build the other Model too?

    I might sound stupid but I would like to have this clear before I go for it…

    Thanx

    Tino

  • Bulkpusta

    @53c6f96d653c6572dcd077d042659222:disqus 
    Everything you will change (add new attribute, change value for product, add new products, …. is written inside EAV tables.
    You import products into EAV tables, magento then ardd new lines into flat tables.
    Flat tables are created in background (If you change something big, they are probably deleted and created again with this new attribute)
    If you add new store (or store view), magento will create new flat table for it.

    Shotrly: don’t worry, everything is still in EAV tables.

  • Bulkpusta

    @53c6f96d653c6572dcd077d042659222:disqus 
    Everything you will change (add new attribute, change value for product, add new products, …. is written inside EAV tables.
    You import products into EAV tables, magento then ardd new lines into flat tables.
    Flat tables are created in background (If you change something big, they are probably deleted and created again with this new attribute)
    If you add new store (or store view), magento will create new flat table for it.

    Shotrly: don’t worry, everything is still in EAV tables.