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

IBX-8019: Added performance consideration notice to LocationService::loadLocationChildren #407

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

webhdx
Copy link
Contributor

@webhdx webhdx commented May 10, 2024

Question Answer
JIRA issue IBX-8019
Type improvement
Target Ibexa version v3.3
BC breaks no

#401 fixed the issue but some performance related issues became apparent. Due to current database schema shape we cannot provide further optimizations. In cases where there are many children, the query has to fetch all records and join version and language tables. This becomes even worse when Permission criterions are applied adding even more JOINs to the query. Test example from the ticket causes 100000 locations to be loaded which is necessary to perform location sort. This is where majority of query time comes from.

The recommendation is to use SearchService::findLocations instead of LocationService::loadLocationChildren where possible. I've added a notice to the method in order to warn people about potential performance issues.

Existing \eZ\Publish\Core\QueryType\BuiltIn\ChildrenQueryType can be used instead of manually creating the query for SearchService.

Related PRs:

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Ran PHP CS Fixer for new PHP code (use $ composer fix-cs).
  • Asked for a review (ping @ezsystems/engineering-team).

@webhdx webhdx self-assigned this May 10, 2024
@webhdx webhdx force-pushed the IBX-8019-Object-state-performance-regression branch from f468ba0 to 33627b3 Compare May 28, 2024 14:14
@webhdx webhdx force-pushed the IBX-8019-Object-state-performance-regression branch from 33627b3 to 99a6d34 Compare May 29, 2024 06:24
Copy link

sonarcloud bot commented May 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@webhdx webhdx changed the title IBX-8019: Replaced multiple JOIN statements with SELECT ... IN query in ObjectStateId Criterion IBX-8019: Added performance consideration notice to LocationService::loadLocationChildren May 29, 2024
@webhdx webhdx marked this pull request as ready for review May 29, 2024 07:51
@webhdx webhdx requested a review from a team May 29, 2024 07:51
@webhdx webhdx added Improvement Changes not fixing or changing behavior Ready for review labels May 29, 2024
@alongosz alongosz requested a review from a team May 29, 2024 08:04
@konradoboza konradoboza requested a review from a team May 29, 2024 08:06
Copy link

@tomaszszopinski tomaszszopinski left a comment

Choose a reason for hiding this comment

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

QA approved on IbexaDXP exp 3.3.37.

@alongosz alongosz merged commit c88c397 into 1.3 Jun 7, 2024
35 checks passed
@alongosz alongosz deleted the IBX-8019-Object-state-performance-regression branch June 7, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Changes not fixing or changing behavior QA approved Ready for review
Development

Successfully merging this pull request may close these issues.

10 participants