IBX-10186: Added limits to Repository Filtering count and subtree queries#696
IBX-10186: Added limits to Repository Filtering count and subtree queries#696
Conversation
| $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.
Add @phpstan-ignore argument.type since it's intentional break of contract :)
ryanolee
left a comment
There was a problem hiding this comment.
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.
| * 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.
| * 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. |
cc4efbc to
10b0d64
Compare
10b0d64 to
39dbd80
Compare
|



Related PRs:
#600
ibexa/admin-ui#1815
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: