Magento has an indexing method that increases page speed of the user interface. The so called EAV (Entity Attribute Value) is data storage solution which is very flexible, but its data reading process is not very fast. Magento indexing is aimed to solve this performance problem.
Magento Indexing is used to improve speed or performance of our web store. Indexing is how Magento changes data such as products, categories etc. As data changes, the changes data must be changed or re-indexed.
Magento has a very sophisticated architecture that stores lots of merchant data (including catalog data, prices, users, and stores) in many database tables. To optimize storefront performance, Magento accumulates data into special tables using indexers.
For example, if you change the price of an item from $4.99 to $3.99. Magento must reindex the price change to display it on your storefront.Without indexing, Magento would have to calculate the price of every product on the fly, taking into account shopping cart price rules, bundle pricing, discounts, tier pricing, etc. Loading the price for a product would take a long time, possibly resulting in cart abandonment.
Depending on whether an index data is up to date, an indexer status value is one of the following:
- valid – data is synchronized, no reindex required
- invalid – the original data was changed, the index should be updated
- working – indexing is in progress
Disadvantages of Magento index
I don’t want to confuse anyone. Magento index is a very useful feature of Magento. But at the same time you need to know about its disadvantages as well. Here are some:
- It duplicates data. Since data are written to the EAV data structure in admin, but on frontend the data are read from the index table. Therefore every product data is duplicated in the database. If you do not pay attention to reindex, it can happen that you see different things on the user interface than in the admin area.
- It needs abundant resources. Magento indexing uses a lot of server capacity because it reads data from a lot of locations.
- It is easy to reach the maximum limit of MySQL column numbers.
Magento Index management commands
How to reindex all available indexing in Magento 2
php bin/magento indexer:reindex
Following command will get you the status of all the indexer whether indexing is required or ready.
php bin/magento indexer:status
You can also check status of individual indexer: let say i want to check status of catalog_category_product
php bin/magento indexer:status catalog_category_product
In case you fill memory limit, try this command
php bin/magento -dmemory_limit=2G magento indexer:reindex
If any index is looping You can reset all index by using
php bin/magento indexer:info
You will receive a similar result as presented below:
design_config_grid Design Config Grid
customer_grid Customer Grid
catalog_category_product Category Products
catalog_product_category Product Categories
catalog_product_price Product Price
catalog_product_attribute Product EAV
catalogsearch_fulltext Catalog Search
catalogrule_rule Catalog Rule Product
catalogrule_product Catalog Product Rule
php bin/magento indexer:reindex design_config_grid customer_grid
php bin/magento indexer:reindex catalog_category_product
php bin/magento indexer:reindex catalog_product_category
php bin/magento indexer:reindex catalog_product_price
php bin/magento indexer:reindex catalog_product_attribute
php bin/magento indexer:reindex catalogsearch_fulltext
php bin/magento indexer:reindex cataloginventory_stock
php bin/magento indexer:reindex catalogrule_rule
php bin/magento indexer:reindex catalogrule_product