mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21012] [CLOSED] perf: eliminate N+1 query for is_user_active in channels #25886
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21012
Author: @Classic298
Created: 1/28/2026
Status: ❌ Closed
Base:
dev← Head:channels-perf📝 Commits (1)
d7b0441perf: eliminate N+1 query for is_user_active in channels📊 Changes
1 file changed (+12 additions, -7 deletions)
View changed files
📝
backend/open_webui/routers/channels.py(+12 -7)📄 Description
Summary
Eliminates N+1 database queries when computing is_active status for DM channel users. Previously, Users.is_user_active was called per user, causing a separate database query for each.
Changes
routers/channels.py get_channels endpoint:
Performance Impact
Before: N queries for N users in DM channels
After: 0 additional queries - uses already-fetched user data
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.