AI Reports

Magento 2 troubleshooting › Store configuration

Should you use the flat catalog in Magento 2.4?

Short answer: No. Adobe has not recommended the flat catalog since Magento 2.3: with modern MySQL and full-page cache it brings little speed and causes indexing problems and stale data. If it's on, turn it off.

The flat catalog copies product and category attributes into wide catalog_product_flat_* and catalog_category_flat_* tables per store view. Every attribute change must then be reindexed into them, which is a frequent cause of products showing old names, prices or status.

Check it step by step

These queries only read data. Run them on a copy of your database if you can, or ask your developer to. If your tables have a prefix (set in app/etc/env.php), add it to each table name.

1. Is it switched on?

Works on Magento Open Source and Adobe Commerce:

SELECT path, scope, scope_id, value
FROM core_config_data
WHERE path IN ('catalog/frontend/flat_catalog_product', 'catalog/frontend/flat_catalog_category');

1 means on. No row means off (the default).

2. Are there flat tables left over?

Works on Magento Open Source and Adobe Commerce:

SELECT table_name, ROUND((data_length + index_length) / 1024 / 1024) AS size_mb
FROM information_schema.tables
WHERE table_schema = DATABASE()
  AND (table_name LIKE 'catalog\_product\_flat\_%' OR table_name LIKE 'catalog\_category\_flat\_%')
ORDER BY table_name;

How to fix it

Related

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn