6

we can see that the following two options at

system > configuration > system > catalog

1.Use Flat Catalog Category

2.Use Flat Catalog Product

it is clear that the flat model reduces the database operations and increase efficiency then why magento can use it by default

is there any reason magento can't enable this option by default , and remove these from system > configuration > system > catalog ?

is it needed for any reasons?

3 Answers 3

3
  1. The flat catalog was introduced in 1.4 so I suppose they didn't wanted to breakdown stores that were already existing and had modules that were based on EAV model restrictly (how a module can fail in flat catalog - great reading here on Alan Storm's blog [always good source of Magento informations]: http://alanstorm.com/magento_flat_collection_chaos)
  2. The EAV system is the most flexible way to store data. The con of it is as you said more and more complicated queries to database but there's more functions that developers can use.
  3. There's not so much performance boost when there isn't so many products in database. Developers/Merchants should be able to decide about that while considering the budget, hosting, traffic, etc.
2
3

The flat catalog flags cannot be enabled by default because in order to use the flat tables they must exist.
The install scripts do not create these tables, because they should be created when everything finishes installing.
This is because some additional modules might add product and/or category attributes that should be added as columns in the flat tables.

You cannot enable the flat flags until you rebuild the indexes for the first time.

Check how the rendered for the flat flags works.
If the flat tables do not exist (or at least one of them) the field is disabled in system->configuration.
Reindexing the flat products and categories will enable the flat flags fields.

0

Note: From Magento 2.3.0+ Magento Flat catalog is not recommended and discouraged.

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 best practice and is not recommended. Continued use of this feature is known to cause performance degradation and other indexing issues."

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.