mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-13 18:44:23 -05:00
[PR #17166] [MERGED] perf: fix N+1 query issues in user group access control validation #11143
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/17166
Author: @sihyeonn
Created: 9/2/2025
Status: ✅ Merged
Merged: 9/3/2025
Merged by: @tjbck
Base:
dev← Head:perf/sh-model-layer📝 Commits (1)
eff0653perf: fix N+1 query issues in user group access control validation📊 Changes
5 files changed (+14 additions, -5 deletions)
View changed files
📝
backend/open_webui/models/knowledge.py(+3 -1)📝
backend/open_webui/models/models.py(+3 -1)📝
backend/open_webui/models/notes.py(+3 -1)📝
backend/open_webui/models/prompts.py(+3 -1)📝
backend/open_webui/models/tools.py(+2 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Changed
get_*_by_user_idmethods in models layer to pre-fetch user group IDsuser_group_idsparameter passing tohas_accessfunctionFixed
Additional Information
knowledge.py,models.py,notes.py,prompts.py,tools.py1 + Nqueries to1 + 1queries across all endpointsContributor 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.