-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Only load attributes relevant to the product's current attribute set #15135
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
Only load attributes relevant to the product's current attribute set #15135
Conversation
@jameshalsall , Thank you for PR! |
Average improvement for all "product" scenarios is about 50%.
Great improvement, Thank you, @jameshalsall ! |
I've reviewed these changes and find out, that we apply not an ideal solution in #13308 which leads us to use also not ideal decisions for fix performance issues. Here are details:
Due to all 3 variants are used in our code base this is potential back-door for bugs. The problem of (2) approach is in using legacy MetadataServiceInterface which not take into account, that entity attributes is belong to attribute set I can give 2 recomendations
Please, note, these recommendations are not mandatory for this PR (it can be processed as is with current changes and in the feature, but until 2.3.0 we can implement proposed changes) |
Hi @jameshalsall
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleModifyExistingSelection
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleModifyExistingOptionOnly
Magento.Bundle.Api.ProductServiceTest.testUpdateProductWithoutBundleOptions
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleAddSelection
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleAddAndDeleteOption
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleModifyExistingSelection
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleModifyExistingOptionOnly
Magento.Bundle.Api.ProductServiceTest.testUpdateProductWithoutBundleOptions
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleAddSelection
Magento.Bundle.Api.ProductServiceTest.testUpdateBundleAddAndDeleteOption
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductOptions
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductWithMediaGallery
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testEavAttributes
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testTierPrices
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testUpdateProductCategoryLinksNullOrNotExists
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testUpdateProductCategoryLinksPosistion
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testUpdateProductCategoryLinksUnassign
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductOptions
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductWithMediaGallery
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testEavAttributes
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testTierPrices
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testUpdateProductCategoryLinksNullOrNotExists
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testUpdateProductCategoryLinksPosistion
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testUpdateProductCategoryLinksUnassign
Magento.Catalog.Api.ProductRepositoryMultiCurrencyTest.testGet
Magento.Catalog.Api.ProductRepositoryMultiCurrencyTest.testGet
Magento.CatalogInventory.Api.ProductRepositoryInterfaceTest.testCatalogInventory
Magento.CatalogInventory.Api.ProductRepositoryInterfaceTest.testCatalogInventoryWithBogusData
Magento.CatalogInventory.Api.ProductRepositoryInterfaceTest.testUpdatingQuantity
Magento.CatalogInventory.Api.ProductRepositoryInterfaceTest.testCatalogInventory
Magento.CatalogInventory.Api.ProductRepositoryInterfaceTest.testCatalogInventoryWithBogusData
Magento.CatalogInventory.Api.ProductRepositoryInterfaceTest.testUpdatingQuantity
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testDeleteConfigurableProductOption
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductOption
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinks
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinksWithNonExistingProduct
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinksWithDuplicateAttributes
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinksWithWithoutVariationAttributes
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testDeleteConfigurableProductOption
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductOption
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinks
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinksWithNonExistingProduct
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinksWithDuplicateAttributes
Magento.ConfigurableProduct.Api.ProductRepositoryTest.testUpdateConfigurableProductLinksWithWithoutVariationAttributes
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductLinks
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductLinksWithNewFile
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductSamples
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductSamplesWithNewFile
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductLinks
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductLinksWithNewFile
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductSamples
Magento.Downloadable.Api.ProductRepositoryTest.testUpdateDownloadableProductSamplesWithNewFile
Additionally, several functional tests are failing on this Pull Request, some of them you may see in the Travis CI job linked to this PR. Could you please take a look at these test failures and maybe try to align the solution with the one described by @mslabko in the comments above? Thanks for collaboration |
Here is a commit from 2.2-develop that corresponds to the first recommendation from my previous comment: |
I'm happy to fix the broken scenarios, but can you point me to some documentation that explains how to run the functional test suite for this repository on my local? |
Hi @jameshalsall Also, please take a look at the comment above by @mslabko: It would be best to align the solution with the one existing in 2.2-develop Thanks |
Hi @jameshalsall Thank you |
Description
This is a port of the fix suggested in #13308 (comment). Currently Magento will load every attribute in the system when creating / updating a product, instead it should only load attributes that are in the product's attribute set.
Consider the following setup:
Magento would load 100,000 attributes, causing a huge increase in the number of queries to the database.
After this change Magento will only load 100 attributes for a product because there are 100 in each attribute set. It also has no impact on smaller set ups.
We observed a ~10x performance boost in the above example setup when creating products via the REST API.
Fixed Issues (if relevant)
N/A
Manual testing scenarios
Contribution checklist