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

Make SearchableBehavior::getRelatedElements() configurable #273

Conversation

joshuapease
Copy link
Contributor

@joshuapease joshuapease commented Sep 15, 2023

Overview

Bringing ticket #242 is back from the dead.


I'm working on a Craft Commerce site with about 250,000 650,000 SKUs.

At that scale, we hit memory limit exceeded errors for some of our Entries that have lots of relationships to Products.

Commenting out these lines in SearchableBehavior::getRelatedElements resolved our issue.

This got me thinking... for many use cases, checking all of these Element Types is overkill. Most of our indexes only have relations between Entry and Asset elements.

Our project still need to index relations, but by removing most Element types from that check, we improve our performance by quite a bit.

@janhenckens janhenckens self-assigned this Nov 16, 2023
@janhenckens janhenckens changed the base branch from master to develop March 1, 2024 18:50
@janhenckens
Copy link
Member

Tested and this looks good to go @joshuapease. I'll get this into the Craft 4 version so you can hopefully "just" upgrade to 5 :)

@janhenckens janhenckens merged commit 1c174e8 into studioespresso:develop Mar 1, 2024
@joshuapease
Copy link
Contributor Author

No way! This made my Friday!

@janhenckens
Copy link
Member

Cheers @joshuapease, thanks for contributing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants