mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #21018] [MERGED] perf: batch fetch filter functions to eliminate N+1 queries #48938
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/21018
Author: @Classic298
Created: 1/28/2026
Status: ✅ Merged
Merged: 1/29/2026
Merged by: @tjbck
Base:
dev← Head:function-perf📝 Commits (1)
9d4f502perf: batch fetch filter functions to eliminate N+1 queries📊 Changes
3 files changed (+24 additions, -12 deletions)
View changed files
📝
backend/open_webui/models/functions.py(+20 -0)📝
backend/open_webui/utils/chat.py(+2 -6)📝
backend/open_webui/utils/middleware.py(+2 -6)📄 Description
Summary
Adds a batch method to fetch multiple functions by ID in a single database query, eliminating N+1 query patterns in filter function loading.
Changes
Performance Impact
For a request with N filter functions:
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.