Running a large Magento 2 store demands better performance and faster loading times to maintain user experience. It becomes difficult to handle a large number of products in the database.
Magento uses EAV (Entity-Attribute-Value) database model for products and categories. In the EAV model, the values are stored in a separate table for every data type. Product attributes in multiple tables will cause long and complex SQL queries for retrieving data.
The alternate option for this is Flat Catalog which creates a flat table that stores all information about the products and categories. The flat table is automatically updated based on the cron job scheduling. Hence, the flat catalog can speed up the processing of the catalog which will enhance the overall performance of the store.
Let’s learn How to Enable a Flat Catalog in Magento 2.
Steps to Enable/Configure Flat Catalog in Magento 2:
- From the admin panel, navigate to Stores > Settings > Configuration.
- Expand the CATALOG option from the left sidebar and select Catalog.
- Enlarge the Storefront option
- Set the Use Flat Catalog Category option to Yes.
- Set the Use Flat Catalog Product option to Yes.
- Lastly, click Save Config.
Verify Flat Catalog for Magento 2:
Step 1: Check results for a Product
- From the Admin Panel, go to Catalog > Products.
- Open any product in edit mode.
- Change the Product Name.
- And Save.
Now search for the product in the storefront. You can notice the changes based on the cron job settings.
Step 2: Check results for a Category
- From the Admin Dashboard, move to Catalog > Categories.
- Select any category and click on Add Subcategory button.
- Activate the Enable Category radio button.
- Give a name to the new category in the Category Name field.
- And Save.
Now check the created category list in the storefront. You can notice the changes based on the cron job settings.
This way you can configure a flat catalog for Magento 2. You can also configure Catalog Search in Magento 2. Share the tutorial with your Magento friends and stay in the loop with us.