-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-10186: Added limits to Repository Filtering count and subtree queries #696
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
base: main
Are you sure you want to change the base?
Conversation
Steveb-p
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @ryanolee.
Please provide your private "no-reply" email so that we co-author you properly to give credit :)
| $this->expectException(InvalidArgumentException::class); | ||
| $this->expectExceptionMessageMatches('/Limit must be greater than 0/'); | ||
|
|
||
| $this->limitedCountQueryBuilder->wrap($qb, 'someField', 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @phpstan-ignore argument.type since it's intentional break of contract :)
ryanolee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good in terms of the original intention of restricting unbounded count queries to something much more processable by the CMS . Thanks for getting this into v5 core! 🎉
It should be noted that the companion PR to this might need to be brought up to date with v5 and is where much of the admin speedup from the changes made in this PR comes from ibexa/admin-ui#1605 given there are quite a few places in the CMS where these unbounded queries can result in significant slowdown!
Feel free to co-commit under rizza@rizza.net 🌟
|
cc @Steveb-p @wiewiurdp 🎉 |
|
Good point @ryanolee! @wiewiurdp could you please handle the companion PR accordingly? |
| * for a SiteAccess in a current context will be used. | ||
| * | ||
| * @param int|null $limit If set, the count will be limited to first $limit items found. | ||
| * In some cases it can significantly speed up a count operation for more complex filters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * In some cases it can significantly speed up a count operation for more complex filters. | |
| * In some cases it can significantly speed up a count operation for more complex filters. |
| * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set | ||
| * for a SiteAccess in a current context will be used. | ||
| * @param int|null $limit If set, the count will be limited to first $limit items found. | ||
| * In some cases it can significantly speed up a count operation for more complex filters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * In some cases it can significantly speed up a count operation for more complex filters. | |
| * In some cases it can significantly speed up a count operation for more complex filters. |
|



Related PRs:
#600
Description:
This one is a community contribution from @ryanolee 🎉 .
This pull request introduces optional query limits to Repository filtering count operations and subtree size calculations in the Ibexa core codebase. The changes aim to improve performance and control resource consumption when performing counting and subtree operations on large datasets.
For QA:
Documentation: