mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-22 09:31:58 -05:00
[GH-ISSUE #21252] feat: convert N groups querys to one query #90162
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @benjamin20000 on GitHub (Feb 8, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21252
Check Existing Issues
Verify Feature Scope
Problem Description
The admin panel and settings are getting very slow after adding groups,
I did a review in backend/models/groups.py and, and saw the following code in the get_groups function:
return [
GroupResponse.model_validate(
{
**GroupModel.model_validate(group).model_dump(),
"member_count": self.get_group_member_count_by_id(
group.id, db=db
),
}
)
for group in groups
]
It looks like this triggers a new database query(and connection) for each group in order to count members, which is very inefficient.
Desired Solution you'd like
get the groups member counts with one query
Alternatives Considered
No response
Additional Context
No response
@pr-validator-bot commented on GitHub (Feb 8, 2026):
⚠️ Invalid Issue Title
Hey @benjamin20000, please provide a descriptive title for your issue. Titles that are empty, very short (under 10 characters), or generic (like "issue:" or "feat:") make it difficult for volunteer contributors to understand and triage issues.
Please update the title to reflect the content of your issue.
⚠️ Missing Issue Title Prefix
@benjamin20000, your issue title is missing a prefix (e.g.,
bug:,feat:,docs:).Please update your issue title to include one of the following prefixes:
Example:
bug: Login fails when using special characters in password@Classic298 commented on GitHub (Feb 8, 2026):
Check the open PRs