Skip to content

fix for #38315 issue (Missing indexing of required columns in catalog_product_entity_int table) #38316

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

Merged

Conversation

rostilos
Copy link
Contributor

@rostilos rostilos commented Dec 25, 2023

Description (*)

Added indexing of entity_id column to avoid cases of "hang" of select query in mysql ( full description of the problem is in linked issue )

For example, after edits, the SELECT query specified in the issue are successful and in a fraction of a second
2023-12-25_21-44
2023-12-25_21-44_1

Related Pull Requests

https://github.com/magento-gl/magento2ee/pull/271

Fixed Issues (if relevant)

  1. Fixes Missing indexing of required columns in catalog_product_entity_int table #38315

Manual testing scenarios (*)

1.A relatively large catalog is needed.
In a test environment, it is reproduced on a test catalog generated with the
bin/magento setup:perf:generate-fixtures setup/performance-toolkit/profiles/ce/extra_large.xml
2. Start the reindex process
bin/magento indexer:reset
bin/magento indexer:reindex catalogsearch_fulltext
3. Successful reindex

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)

Copy link

m2-assistant bot commented Dec 25, 2023

Hi @rostilos. Thank you for your contribution!
Here are some useful tips on 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 Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@rostilos
Copy link
Contributor Author

@magento run all tests

Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Dec 26, 2023
@rostilos
Copy link
Contributor Author

@magento run all tests

Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Dec 27, 2023

According to failed tests, it works fine for Magento Open Source but won't work for Magento Commerce / B2B (conflicts with the Content Staging feature).
Do you think you'll be able to make it compatible?

@rostilos
Copy link
Contributor Author

rostilos commented Dec 27, 2023

Yeah, I'll try to fix that
But to be honest, don't have much experience with B2B and EE versions

@rostilos
Copy link
Contributor Author

@magento run Database Compare

Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@rostilos
Copy link
Contributor Author

rostilos commented Dec 29, 2023

@ihor-sviziev
Proposal for a fix.
I can't make compatibility with B2B and EE modules through edits in this repository. But, if edits are made, maybe you could make edits for DB schema in magento-catalog-staging module ?
2023-12-29_10-35

<index referenceId="CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID_ENTITY_ID" disabled="1"/>
<index referenceId="CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID_ROW_ID" indexType="btree">
     <column name="attribute_id"/>
     <column name="row_id"/>
</index>

@ihor-sviziev
Copy link
Contributor

@engcom-Hotel maybe you can help with fixing b2b/ee part?

@sinhaparul sinhaparul added the Project: Community Picked PRs upvoted by the community label Jan 25, 2024
@tdgroot
Copy link
Member

tdgroot commented Jan 30, 2024

I'm in favor of this PR, but don't we also need to keep the standalone ATTRIBUTE_ID index? Surely some functionality somewhere depends on that index to exist, so to me this seems like a regression.

@engcom-Echo
Copy link
Contributor

@magento run all tests

@ihor-sviziev ihor-sviziev removed their request for review February 19, 2025 11:04
Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

Hi @engcom-Hotel
Looks like comment #38316 (comment) from @tdgroot were missed.
I'm agree with it and update looks like regression. We should add new index instead of update exist one.

@engcom-Hotel
Copy link
Contributor

Valid point made by @tdgroot here #38316 (comment).

Thanks @Den4ik for highlighting this. Moving this PR in Changes Requested bucket for the changes. @rostilos please do the needful for the same.

Thanks

@engcom-Hotel engcom-Hotel moved this from Pending Approval to Changes Requested in Community Dashboard Mar 26, 2025
@rostilos
Copy link
Contributor Author

@engcom-Hotel I agree with the comments above. Ok, will add this soon and test it from my end

@engcom-Hotel
Copy link
Contributor

Thanks @rostilos, please let us know when are done with the changes. Meanwhile moving this PR as 'draft'.

@engcom-Hotel engcom-Hotel marked this pull request as draft April 1, 2025 13:37
@rostilos rostilos marked this pull request as ready for review April 3, 2025 10:27
@rostilos
Copy link
Contributor Author

rostilos commented Apr 3, 2025

@engcom-Hotel added requested edits

Also, I remind you that the corresponding changes should be added to the EE version
#38316 (comment)

@rostilos
Copy link
Contributor Author

rostilos commented Apr 3, 2025

@magento run all tests

@engcom-Charlie engcom-Charlie self-assigned this Apr 7, 2025
@Den4ik
Copy link
Contributor

Den4ik commented Apr 7, 2025

@magento run all tests

Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

@engcom-Hotel Changes looks good. Please assist with updates for EE and B2B

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE, Static Tests, Unit Tests

@engcom-Charlie
Copy link
Contributor

Hi @rostilos,

Thank you for your contribution!

@ihor-sviziev and @Den4ik thank you for the review.

The mentioned changes have been already taken care in the attached Related PR https://github.com/magento-gl/magento2ee/pull/271, please find the changes below and the functional EE test is green.

image image

I have fixed the static test failure in the same above EE PR.

I also dont see any need for these approval JIRAs as the SVC and Database compare are working fine now.

The Functional B2B failure is not consistent in recent 2 builds and it seems to be flaky.

Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38316/207e4253d63539f4eb5a9164056517cf/Functional/allure-report-b2b/index.html#categories
image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38316/da1c806f1b255e289be017ddc771cb18/Functional/allure-report-b2b/index.html#categories

image

@ihor-sviziev requesting you for review once so that we can able to proceed further on this PR. Please let me know if anything else is needed.

@engcom-Charlie engcom-Charlie moved this from Changes Requested to Pending Review in Community Dashboard Apr 8, 2025
@engcom-Charlie
Copy link
Contributor

@magento run Static Tests

@engcom-Charlie
Copy link
Contributor

Thank you @ihor-sviziev for the quick check and approval.

QA has been done as mentioned here. Hence moving the PR to Extended Testing to look into the static failure.

@engcom-Charlie engcom-Charlie moved this from Pending Review to Extended testing (optional) in Community Dashboard Apr 9, 2025
@engcom-Charlie
Copy link
Contributor

Static test is green now and B2B is flaky as mentioned above. Hence moving this PR to Merge in Progress.

@engcom-Charlie engcom-Charlie moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Apr 9, 2025
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 0ac260f into magento:2.4-develop Apr 25, 2025
11 of 12 checks passed
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Merge in Progress to Recently Merged in Community Dashboard Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Performance help wanted Partner: Perspective Team 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: needs update Progress: pending approval Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Recently Merged
Development

Successfully merging this pull request may close these issues.

Missing indexing of required columns in catalog_product_entity_int table