Magento version: 2.3.1

When I run inventory reindex from command line it first runs inventory reindex and then price reindex after that.

Here is the command I executed:

bin/magento indexer:reindex inventory

Output on console:

Inventory index has been rebuilt successfully in 00:00:40
Product Price index has been rebuilt successfully in 00:08:10
Catalog Search index has been rebuilt successfully in 00:25:01

As you can see from console output, price and catalog search reindex also executed.

How can I prevent running price reindex automatically? I want just inventory reindex.

  • How do you run indexes? What commands? What sequence? May 29 '19 at 17:32
  • @DominicXigen updated the command and output in question May 30 '19 at 4:44

Not exactly what you are look for, but this might be helpful.

As Eugene mentioned, to keep the data consistency price indexing is bound to inventory indexing.

Have a look at below code in the file vendor/magento/module-catalog-inventory/etc/mview.xml.

 <view id="catalog_product_price" class="Magento\Catalog\Model\Indexer\Product\Price" group="indexer">
            <table name="cataloginventory_stock_item" entity_column="product_id" />

What this materialized view code does is, it adds a trigger to cataloginventory_stock_item table.

If your inventory indexing is configured to 'Update by Schedule' and when there is a change in product inventory in cataloginventory_stock_item table, it makes entry for product in table catalog_product_price_cl.

When price indexing runs, catalog_product_price_cl table is used to identify the product ids for which price indexing needs to run.

If you want to disable entry in catalog_product_price_cl table during inventory indexing, you need to override this file and comment the code and run setup:upgrade. It will remove the trigger from cataloginventory_stock_item table. Of course you need to verify that there isn't any data inconsistency after this modification.


Described behavior may seem to be completely unobvious, however it's expected.

The thing is, that indexers may depend on each other, like in your case, Catalog Search indexer depends on Price indexer, which, in turn depends on Inventory index. This chain might not be optimal, however all of them must run to ensure data consistency, as inventory availability may impact data in the price index and so on.

Indexer dependencies are configured via DI configuration, and I believe it's possible to override this config for your specific case. However, this is not something I would recommend, as it may impact data consistency and correct display of catalog information.

Looking at the initial question I assume that you are concerned about performance. Have you looked into reindex on save or reindexing at a time when store does not experience biggest customer flows? This kind of problem may be mitigated in different ways depending on your business scenario. Please let us know the details and might find a solution together.


If you want to first runs inventory reindex and then price reindex after that.

You have to need run below command for individual selected indexer run.

php bin/magento indexer:reindex cataloginventory_stock

php bin/magento indexer:reindex catalog_product_price

  • I have updated command and output in the question. Let me know if you can help. May 30 '19 at 4:45
  • Yes let me know what is the issue after run above command step by step. May 30 '19 at 4:47
  • Issue is, I'm running command to reindex only inventory but if you see the console output, its reindexing price and catalog search as well. I dont want price and catalog search to run after inventoy reindex. May 30 '19 at 4:51
  • If you run cmd: php bin/magento indexer:reindex cataloginventory_stock then only execute Stock index. May 30 '19 at 5:07
  • I tried that. It does not reindex price but Catalog Search reindex is still happening. Here is the output: bin/magento indexer:reindex cataloginventory_stock Stock index has been rebuilt successfully in 00:00:00 Catalog Search index has been rebuilt successfully in 00:00:01 May 30 '19 at 5:27

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.