-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 60009: Load products in bulk to reduce expensive queries
## What's being changed This PR further reduces SQL queries by loading products in bulk wherever possible. Products are cached by store id because, for brand values: - attributes can be global, website or store scoped - for store-scoped attributes, options can change between store scopes, as can the values of those options Example: - The Dotdigital Brand Attribute is set to 'Manufacturer' - Products can in theory have a different Manufacturer per store - The options for Manufacturer may be presented as 'Company A, 'Company B' and 'Company C', but in the attribute configuration the actual option text for each can vary (for example 'Le Company A' etc for a French store view). ## Why it's being changed Individual orders may have many associated products. All these need loading in order to arrive at a string of category ids for FIRST_CATEGORY_PUR and LAST_CATEGORY_PUR. Each time we replace e.g. 10 product entity loads with a single query, there is a reduction in resource utilisation. ## How to review / test this change - Compare the JSON exported from develop with the JSON exported on this branch - See no change - Further test steps specific to brand values in different scopes to follow in the next PR. ## Notes We can go further and restrict the attributes loaded in the collection query in the ProductLoader. This will follow in a separate PR. Related work items: #278457
- Loading branch information
Showing
3 changed files
with
121 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters