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

Do not reindex catalog_product_flat for disabled stores #3251

Merged
merged 10 commits into from
Jul 12, 2023
Merged

Do not reindex catalog_product_flat for disabled stores #3251

merged 10 commits into from
Jul 12, 2023

Conversation

empiricompany
Copy link
Contributor

Description (*)

skip reindex product flat tables for disabled store view

Questions or comments

We have one store with 6 language stores, of which only one is enabled. The reindexing of the product flat tables takes unnecessarily long. The idea is to skip the reindexing of disabled stores. I don't think this will create any problems because these tables are not actually used on the frontend. Are there any potential issues with this approach?

We should add a message indicating that a reindex is required when the store is re-enabled, similar to what happens with the index catalog_product_attribute.

@github-actions github-actions bot added the Component: Catalog Relates to Mage_Catalog label May 14, 2023
@fballiano
Copy link
Contributor

wow, this could be a great improvement, how did it slip for so many years...

sorry for reformatting the "continue", I also prefer the one line but PHPCS doesn't :-(

fballiano
fballiano previously approved these changes May 14, 2023
@fballiano fballiano marked this pull request as ready for review May 14, 2023 18:43
@sreichel
Copy link
Contributor

Message after enable store needs to be added.

@empiricompany
Copy link
Contributor Author

Message after enable store needs to be added.

I'm not an indexer expert, but now the reindex request message also appears for catalog_product_flat.
The code that checks if it's a save and was previously disabled was taken from the EAV index (app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php).
I'm just wondering if anything else needs to be added in _registerEvent.

@empiricompany empiricompany requested a review from tmotyl June 8, 2023 07:29
Copy link
Contributor

@kyrena kyrena left a comment

Choose a reason for hiding this comment

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

Full reindex: from 02:37 (before) to 01:23 (after).

Notice is displayed after enabling a store view.
I dropped catalog_flat tables and I reindexed multiple times, all seems good for front.

This probably also can be done for catalog_category_flat.
Moreover there are multiple Mage::app()->getStores().

@fballiano fballiano changed the title do not reindex catalog_product_flat for disabled stores Do not reindex catalog_product_flat for disabled stores Jul 10, 2023
@fballiano
Copy link
Contributor

merging per 1green and 2grays

@fballiano fballiano merged commit 8aae6e2 into OpenMage:main Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Relates to Mage_Catalog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants