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

MariaDB Casting is too slow #35564

Merged
merged 3 commits into from
Dec 16, 2022
Merged

Conversation

osrecio
Copy link
Member

@osrecio osrecio commented Jun 1, 2022

When the MariaDB is try to cast the entitys_ids from string to integer is to slow,

Check: #27129

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Change value for simple products to 50000 for example (setup/performance-toolkit/profiles/ce/small.xml);
  2. Run in console: bin/magento setup:perf:generate-fixtures /var/www/html/magento24/setup/performance-toolkit/profiles/ce/small.xml for example
  3. Reindex

In this PR, when you try to reindex EAV, the query can be vary from:

  • [before] with quotes -> 7882 rows in set (34.460 sec)
  • [after] no quotes -> 7882 rows in set (0.086 sec)

Questions or comments

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] MariaDB Casting is too slow #35568: MariaDB Casting is too slow

When the MariaDB is try to cast the entitys_ids from string to integer is to slow,

Check: #27129
@m2-github-services m2-github-services added Partner: Interactiv4 Pull Request is created by partner Interactiv4 partners-contribution Pull Request is created by Magento Partner labels Jun 1, 2022
@m2-assistant
Copy link

m2-assistant bot commented Jun 1, 2022

Hi @osrecio. Thank you for your contribution
Here are 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@ihor-sviziev
Copy link
Contributor

Hi @osrecio,
Your changes look good to me.
Could you please provide steps to reproduce the issue?

@osrecio
Copy link
Member Author

osrecio commented Jun 1, 2022

Hi @ihor-sviziev ,

I added some manual steps, seems like in the previous PR, not all possibilities were covered.

In this PR, when you try to reindex EAV, the query can be vary from:

  • [before] with quotes -> 7882 rows in set (34.460 sec)
  • [after] no quotes -> 7882 rows in set (0.086 sec)

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Jun 1, 2022

@osrecio thank you!

@magento run all tests

PS: Added label of "auto-tests: not required" because such case would be really hard to test automatically + it's reproducing the only on some specific environments (MariaDB should be used as a DB)

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev ihor-sviziev added Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Area: Performance Award: bug fix labels Jun 1, 2022
@m2-community-project m2-community-project bot removed this from Pending Review in Pull Requests Dashboard Jun 1, 2022
@ihor-sviziev
Copy link
Contributor

@magento create issue

@m2-assistant m2-assistant bot mentioned this pull request Jun 1, 2022
5 tasks
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ Approved.

Failing tests look not related to changes from this PR.

@engcom-Alfa
Copy link
Contributor

@magento Functional Tests B2B, Functional Tests CE, Functional Tests EE

@engcom-Alfa
Copy link
Contributor

Hi @osrecio & @ihor-sviziev Thanks for your contribution and collaboration!
I tried to test the performance improvements with the fixes and below is my observation

  1. Made sure that, I have products with the count 50k+, that I got using performance toolkit file large.xml.
  2. From the Magento root directory, executed the command: php bin/magento indexer:reindex catalog_product_attribute
  3. Noted the time taken and it was Product EAV index has been rebuilt successfully in 00:08:32
  4. Later, I pulled this PR file changes into my current Magento instance, and re-ran the same command.
  5. Observed that, the tike taken is Product EAV index has been rebuilt successfully in 00:08:34. Below is the screenshot of prior code changes and after code changes output.

image

Here, noticeable thing is, it has taken 2 seconds more time to the prior file changes execution. I re-tried the same scenario twice in my system and found the same 2 seconds more time taken both the times.
Can you please check once and let me know if I have missed anything here. Or whether may require any more code changes from your end too!

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

1 similar comment
@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@engcom-Alfa
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@engcom-Lima
Copy link
Contributor

Hi @osrecio ,

Thanks for your contribution and collaboration.

As per your comment it should take very less time to reindex EAV.

In this PR, when you try to reindex EAV, the query can be vary from:

[before] with quotes -> 7882 rows in set (34.460 sec)
[after] no quotes -> 7882 rows in set (0.086 sec)

But I have observed It is still taking longer time to reindex EAV. Below are the steps which I have followed -

  1. Installed magento 2.4-develop using mariadb.
  2. Creating 5 lakh products using performance fixtures (large profile)
  3. Ran bin/magento indexer:reindex catalog_product_attribute

Time taken before PR change:
Screenshot 2022-11-29 at 5 03 55 PM

Time taken after PR change:
Screenshot 2022-11-29 at 7 33 15 PM

From above screenshots we can see time difference is only 1 min. Can you provide information about it.

Thanks

@engcom-Lima
Copy link
Contributor

Hi @osrecio ,

Please provide information for above comment so, that we can proceed further as soon as possible.

Thanks

@engcom-Lima
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@engcom-Lima
Copy link
Contributor

engcom-Lima commented Dec 5, 2022

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Manual testing scenario:

  1. Installed magento 2.4-develop using mariadb.
  2. Creating 5 lakh products using performance fixtures (large profile)
  3. Ran bin/magento indexer:reindex catalog_product_attribute

Before: ✖️
Screenshot 2022-11-29 at 5 03 55 PM

After: ✔️ Observed time difference of 1 min.
Screenshot 2022-11-29 at 7 33 15 PM

No additional manual test case is required as part of regression cycle.

@engcom-Lima engcom-Lima moved this from Testing in Progress to Merge in Progress in High Priority Pull Requests Dashboard Dec 5, 2022
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 444de78 into 2.4-develop Dec 16, 2022
@sidolov sidolov deleted the osrecio-patch-1 branch February 26, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Performance Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix Partner: Interactiv4 Pull Request is created by partner Interactiv4 partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] MariaDB Casting is too slow