Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger on product update, when it's not needed #110

Open
jspoe opened this issue May 3, 2023 · 0 comments
Open

Trigger on product update, when it's not needed #110

jspoe opened this issue May 3, 2023 · 0 comments

Comments

@jspoe
Copy link

jspoe commented May 3, 2023

Currently, for every product update, the trg_catalog_product_entity_after_update, trg_catalog_product_entity_datetime_after_update, trg_catalog_product_entity_text_after_update, trg_catalog_product_entity_tier_price_after_update etc. etc. triggers updates the bazaarvoice_product_cl (changelog) table to process changes by the indexer. (Adobe Commerce, row_id, updated_in)

E.g. but there are more (see mview.xml)
IF (NOT(NEW.row_id <=> OLD.row_id) OR NOT(NEW.entity_id <=> OLD.entity_id) OR NOT(NEW.created_in <=> OLD.created_in) OR NOT(NEW.updated_in <=> OLD.updated_in) OR NOT(NEW.attribute_set_id <=> OLD.attribute_set_id) OR NOT(NEW.type_id <=> OLD.type_id) OR NOT(NEW.sku <=> OLD.sku) OR NOT(NEW.has_options <=> OLD.has_options) OR NOT(NEW.required_options <=> OLD.required_options) OR NOT(NEW.created_at <=> OLD.created_at)) THEN INSERT IGNORE INTO bazaarvoice_product_cl (entity_id) VALUES (NEW.entity_id); END IF;

I think this is too heavy, because the Bazaarvoice does not need to know about everything that is changed on a product. As a matter of fact, the bazaarvoice_index_product table only holds limited information that does not change that often.


I opt to create an alternative trigger for this, for example by setting a hash composed of the attributes in the bazaarvoice_index_product table and trigger based on a hash change instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant