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

Use category collection to load product categories in single query #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewkett
Copy link

@andrewkett andrewkett commented Dec 22, 2019

Currently on product pages the extension carries out a category load for every category that the product is in, this results in a database read each time. On sites that have a lot of categorisation this means a large number of queries are carried out for something that could be achieved in a single query.

This pull request replaces the category load with a category collection loading categories by id, this will always use a single query to load the product categories.

@snoop0x7b
Copy link
Contributor

Any update on this Klaviyo team? Query in a loop can be a huge performance anti-pattern in Magento which could make customers' stores really slow.

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

Successfully merging this pull request may close these issues.

2 participants