1

What exactly is the purpose of the "Catalog Product Rule" and "Catalog Rule Product" indexes?

Which functionalities do they cover?

I am just wondering, because there are often a lot of entries in the backlog of the indexer and we are not using any product rules within Magento that I know of.

Thus I am wondering if I can disable those indexes to make the indexer_update_all_views cron job a little faster.

Update --------------

As answered by Rakesh Donga, "Catalog Product Rule" are the Cart Price Rules and "Catalog Rule Product" are the Catalog Price Rules (awful naming though ;)).

Since we have not defined any such rules in our shop: why are there still so many entries to be indexed for the "Catalog Product Rule" index? Are there base rules that Magento always accounts for?

2

Catalog Product Rule : This indexer creates and updates the created Shopping cart price rule set
Catalog Rule Product: This indexer creates and updates the created catalog price rule set

1
  • Hm, that does not really explain the difference though. What is a "shopping cart price rule set" and what is a "catalog price rule set"? // edit: ah found the information now, I'll update my question accordingly – fritzmg Aug 23 '19 at 8:52
2

Please find below my explanation for these 2.

catalogrule_rule - Catalog Product Rule (The reindex all the catalog rule "conditions", as soon as you update any condition like 10% discount or something, this needs to re-run)

catalogrule_product - Catalog Rule Product (If you update the product on which catalog rule will be applied)

I hope this helps.

2
  • The explanation is good. Thanks for sharing. – Rahul Anand Aug 23 '19 at 9:18
  • Yes, it answers the original question. It does not explain though, why there are indexing entries even though we have no rules defined whatsoever. – fritzmg Aug 23 '19 at 9:51
0

Both "Catalog Product Rule" (catalogrule_product) and "Catalog Rule Product" (catalogrule_rule) indexers belongs to Catalog Price Rule functionality.

Table catalogrule_product_cl ("Catalog Product Rule" indexer change log table) is populated even You don't have defined any "Catalog Price Rule". This is because of mview implementation. In file vendor/magento/module-catalog-rule/etc/mview.xml You can see that catalogrule_product subscribes tables like catalog_product_entity, catalog_product_entity_datetime etc. This means that trigger is created in database that will add values to table catalogrule_product_cl if You change any value in table that is subscribed. This functionality works on database level. You can try it by manually change values in table catalog_product_entity_decimal. You will see that entries are added to catalogrule_product_cl table. After use command bin/magento indexer:status You can see that entries number in backlog of "Catalog Product Rule" indexer is increasing. I would like to mention that in backlog You see number of unique entity_id elements occuring in table catalogrule_product_cl from version_id defined in row catalogrule_product in table mview_state to last element.

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.