Skip to content

[Backport] small performance improvement on product listing#19336

Merged
magento-engcom-team merged 1 commit intomagento:2.2-developfrom
gelanivishal:2.2-develop-PR-port-18773
Nov 23, 2018
Merged

[Backport] small performance improvement on product listing#19336
magento-engcom-team merged 1 commit intomagento:2.2-developfrom
gelanivishal:2.2-develop-PR-port-18773

Conversation

@gelanivishal
Copy link
Copy Markdown
Contributor

@gelanivishal gelanivishal commented Nov 22, 2018

Original Pull Request

#18773

Description (*)

Get rid of unnecessary reviews queries on product listing:
"select review_entity_summary.* from review_entity_summary where (review_entity_summary.entity_pk_value = ?) and (store_id = ?)"
This query was executed for each product on listing which didn't have a review summary(@see: Magento\Review\Model\Review::appendSummary and Magento\Review\Block\Product\ReviewRenderer::getReviewsSummaryHtml)

Manual testing scenarios (*)

  1. Use a profiler(e.g. blackfire)
  2. Go to any product listing page(category page)
  3. After profiling the product listing page you should notice that for each product which doesn't have a review an additional sql query is executed: "select review_entity_summary.* from review_entity_summary where (review_entity_summary.entity_pk_value = ?) and (store_id = ?)"

E.g.: if on your product listing page you are listing 20 products, and 3 products have reviews, you will see 17 x "select review_entity_summary.* from review_entity_summary where (review_entity_summary.entity_pk_value = ?) and (store_id = ?)"

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Get rid of unnecessary reviews queries on product listing:
"select review_entity_summary.* from review_entity_summary where (review_entity_summary.entity_pk_value = ?) and (store_id = ?)" 
This query was executed for each product on listing which didn't have a review summary(@see: Magento\Review\Block\Product\ReviewRenderer::getReviewsSummaryHtml)
@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @gelanivishal. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.2-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-3532 has been created to process this Pull Request

@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @gelanivishal. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants