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

Suggest it for better performance #12

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

Conversation

repalo
Copy link

@repalo repalo commented Mar 14, 2017

No description provided.

@aude
Copy link

aude commented Oct 16, 2017

I have also experienced this performance issue.

The issue here is that the code will load every richsnippet every time getSnippetByProductIdAndStoreId() is called, because it uses getItemByColumnId(). This is critically bad for performance.

My suggestion is to change

$snippet = $col->getItemByColumnValue('product_id', $product_id);

to something like

$col->addFieldToFilter('product_id', $product_id);
$snippet = $col->getFirstItem();

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.

3 participants