Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #3920: Paginate /glossaryTerms/assets/counts and use bulk aggregation #27934
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?
Uh oh!
There was an error while loading. Please reload this page.
Fix #3920: Paginate /glossaryTerms/assets/counts and use bulk aggregation #27934
Changes from all commits
8da0956File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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.
💡 Quality: listGlossaryTermFqns loads all entities into memory on every call
When
parentis null,listGlossaryTermFqnscallslistAll(...)which loads everyGlossaryTermentity in the system into memory just to extract FQNs. For large deployments with thousands of glossary terms, this creates GC pressure on every paginated request. Consider using a lighter DAO query that returns only FQNs (a projection), or caching the sorted FQN list with a short TTL.Was this helpful? React with 👍 / 👎 | Reply
gitar fixto apply this suggestionThere 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.
Every call to
getGlossaryTermsAssetsCountinvokesfetchAssetCountsByGlossaryTermFqn()which runs an unfiltered aggregation ontags.tagFQNacross ALL indexed entities, bounded only byMAX_AGGREGATE_SIZE(10,000 buckets). This has two implications:limit=2still triggers the full aggregation. The perf win comes from replacing N searches with 1, but the single aggregation is still global.Consider scoping the aggregation to only the FQNs in
pageFqns(e.g., via atermsfilter on the tag FQN field) or at least filtering to the parent prefix. This would both reduce the bucket count and make paginated calls genuinely lighter.Suggested fix:
Was this helpful? React with 👍 / 👎 | Reply
gitar fixto apply this suggestionThere 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.
💡 Edge Case: limit=0 returns empty result — may confuse callers expecting metadata only
The
@Min(0)annotation on thelimitparameter allowslimit=0. InsliceFqns, this produces an empty sublist, and becausepageFqns.isEmpty()is true, the method returns early with an empty counts map (but a valid total). While technically correct,limit=0is an unusual API contract — some callers might use it expecting to fetch only the total count. If that's intentional, it's fine as-is. If not, consider changing@Minto 1.Was this helpful? React with 👍 / 👎 | Reply
gitar fixto apply this suggestionUh oh!
There was an error while loading. Please reload this page.