Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Frontend Flat Catalog - More Info??? 
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

Hi all,

Can we have more info on what ‘Frontend Flat Catalog’ exactly means?? Is there some documentation or pointers on what this is?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Good call - I’d also like to see an idiots guide on it…

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 

I think it’s just their name for some technique that should improve the performance. Maybe they call it “flat” because it stores/caches a couple more things in the database that would otherwise need multiple queries.

So you don’t really need a guide. Just activate it and see if you gain any performance smile

But I’d also be interested in what it does exactly, more out of curiosity.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

A wiki article on Flat Catalog would be good.....  more info please.

 
Magento Community Magento Community
Magento Community
Magento Community
 
stefanov.a
Jr. Member
 
Total Posts:  2
Joined:  2009-02-21
 

That would be interesting...more info somebody

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

From what i understood…

Imagine a product had only the following data:

- Id (number)
- Created on (date)
- Name (text)
- SKU (text)

The common way to store this information would be to have one table holding all of this info. But, magento uses the EAV database structure, which is quite different… In this scheme, the data is divided by the data type on smaller tables. For our above simplified product, the tables would be:

- product - Stores the id
- product_datetime - Holds the product’s id and the “Created on” value
- product_varchar - Holds the product’s id and the attributes “Name” and “SKU”.

When magento shows a product, it joins these tables using the product id. Using the EAV method it is possible to add and remove attributes without making any drastic changes on the table structure, making the upgrade proccess much easier, and a lot of other advantages for developers.

With the flat product feature, magento keeps one updated table which joins all the product’s attributes in only one place. So, in our hypothetical example above, when you click “Rebuild flat product table”, magento will populate it’s flat table, gathering all product’s info in only one table. The flat table would have the following fields:

| id | created on | name | sku |

After enabling the flat catalog, magento will start looking for products data on the flat table, instead of joining tables every time it shows a product.

The process is a little bit more complicated than that, since the product has around 50 attributes, plus the user-created attributes, plus 3 different data types, and multiple stores and languages. But that can give you an idea of how it works.

You can find detailed info on EAV here.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nick Rigby
Member
 
Total Posts:  57
Joined:  2007-09-03
 

Thanks for the info Gabriel.

I think the important question for me is, are there any drawbacks to enabling the flat catalog? If it’s main feature is performance increase, then is there any reason why it shouldn’t be enabled in Magento by default?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Hi Nick,

I guess the main reason for it not to be enabled by default is that it is a new feature, a big modification in the magento system, and it can bring up new bugs with it. Actually, there are some popping up already, just take a look at the forums. =) Also, if you don’t have a huge amount of products on your store (Varien says less than 1000, I would say less than that), you don’t really need to use the flat table because the EAV scheme won’t really mean a performance decrease.

About the drawback, as you would have data stored in two places with the flat catalog options enabled (the eav tables and the flat table), it can occur that the flat table gets outdated by some reason (namely: bug). But after a few months of bug extermination, i think there will be no reason for it not to be enabled.

I haven’t seen the code deep enough though, there might be something i’m missing here. =)

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Ah, yes, one drawback is that it will use more space from your database quota. Now you will have some replicated data on your database, so…

Another one: everytime you create or update a product, it has to update the flat table as well… So, it will get a little slower when doing such things, but i don’t think you will notice it…

But the performance gain is great. Guess i’ll activate it on my shops in some weeks. =)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nick Rigby
Member
 
Total Posts:  57
Joined:  2007-09-03
 

Thanks for the info Gabriel, very useful.

Yeah, I’ll be waiting a few weeks before updating to 1.3 (and taking advantage of the flat catalog) but it sounds brilliant in theory if the performance increase is as noticeable as it’s supposed to be.

Thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

I am hoping Magento enables you to turn off the other tables if not using them as updating two tables with the same information seems ridiculous.  Our whole ability to interact with Magento is through the DB as the dataflow is worthless for large catalogs with price updates, inventory updates, attribute updates etc. etc..  While the performance change will be welcomed, this idea of maintaining another table sounds daunting.  I hope Magento has a decent plan for those of us who work directly with the DB and large catalogs.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Hi Roco,

I have actually dealt with this issue yesterday.

I have imported 1100 products via the DB to a new magento install. Once you click “Rebuild flat catalog”, it reads the old eav structure and populates the flat one, so, no big trouble for us here.

In any case, if you really need to disable the flat catalog feature, you can just go to System -> Configuration -> Catalog and disable it. =)

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
cbsteven
Member
 
Total Posts:  73
Joined:  2008-07-25
 

It’d be nice if you could just edit the flat DB correctly and ignore the relational DB.. would probably be easier to set up and maintain. I doubt it’s possible though. We have a 30,000-item catalog and are building a solution using the API. It imports at a paltry 500 items/hour.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

Thanks Gabriel for the post. 

Amen to that cbsteven!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

yeah, second that, cbsteven! At least for the “one-to-one” case that would be excellent.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
ShopGuy
Guru
 
Total Posts:  462
Joined:  2008-09-07
 
cbsteven - 02 April 2009 07:14 AM

It’d be nice if you could just edit the flat DB correctly and ignore the relational DB.. would probably be easier to set up and maintain. I doubt it’s possible though. We have a 30,000-item catalog and are building a solution using the API. It imports at a paltry 500 items/hour.

Have you thought of running multiple import processes, so you would get 500 items/hour/process ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2