Resolving the Magento Flat Catalog Attribute Error
When attempting to enable the Product Flat Data reindexing feature in Magento, you may encounter an error message similar to this:
The Flat Catalog module has a limit of 64 filterable and/or sortable attributes. Currently there are 521 of them. Please reduce the number of filterable/sortable attributes in order to use this module.
This can be quite confusing, especially when your attribute management shows only around 300-320 attributes defined. So where is Magento getting the value of 521 currently used attributes from?
Understanding the Attribute Count
When you look at the attributes list in the Magento admin panel (Catalog > Attributes), it displays all the configurable product attributes across your store. However, this doesn’t tell the full story.
The attribute count that Mageto’s Flat Catalog module refers to includes all attributes associated with any products in your catalogâeven if those products don’t use certain attributes. This is why you might see a higher number than what’s actually configured in the admin panel.
Filterable and Sortable Attributes
The error specifically mentions “filterable and/or sortable” attributes. These are attributes that can be used for layer navigation, price range filters, or sorting options on your frontend product listings.
By default, Magento considers many core attributes as filterable/sortable (e.g., size, color, price). Even if you haven’t explicitly configured these options in the attribute settings, Magento still includes them in its calculations.
The 64 Attribute Limit
The limit of 64 filterable/sortable attributes is a technical constraint imposed by PostgreSQL for creating array columns. Magento uses this database constraint as the maximum number of unique filterable/sortable attributes allowed in the Flat Catalog tables.
Reducing Your Attribute Count
To resolve this issue, you’ll need to reduce the number of filterable and sortable attributes below 64:
-
Disable Unused Attributes: Review your product attributes and disable any that aren’t actually used on your products or in your frontend filters/sort options.
-
Check Product Attribute Sets: Ensure that you’re not assigning too many unique attributes to different product types or attribute sets.
-
Refactor Your Product Data Structure: If necessary, consider consolidating multiple similar attributes into one (e.g., instead of “Size S”, “Size M”, and “Size L”, create a single “Size” attribute with a dropdown menu).
Enabling Flat Catalog Indexing
Once you’ve reduced the number of filterable/sortable attributes below 64, follow these steps to enable flat indexing:
- Log in to your Magento admin panel.
- Navigate to System > Configuration > Catalog > Frontend.
- Set “Flat Catalog Category” and “Flat Catalog Product” to Enable.
- Save the configuration and reindex all indexes.
Conclusion
The Magento Flat Catalog error about attribute limits is often misleading due to the way it calculates these values. By understanding where the 521 attribute count comes from and how to reduce your filterable/sortable attribute count, you can resolve this issue and optimize your Magento performance.
For a more detailed guide on Magento indexing best practices, check out our article on Improving Magento Performance with Proper Indexing.