mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #15155] [CLOSED] feat: Add performance indexes and migration script #23738
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/15155
Author: @decent-engineer-decent-datascientist
Created: 6/19/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (4)
23159c2added basic indexing and a migration plan888a98cadded migration planf96b8ecadded the PK on tag back, whoopsa713e14Merge branch 'open-webui:dev' into dev📊 Changes
4 files changed (+82 additions, -5 deletions)
View changed files
➕
backend/open_webui/migrations/versions/20250619_add_indexes_for_performance.py(+57 -0)📝
backend/open_webui/models/chats.py(+15 -1)📝
backend/open_webui/models/functions.py(+5 -1)📝
backend/open_webui/models/tags.py(+5 -3)📄 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
chat,tag, andfunctiontables to dramatically improve query performance on large SQLite and PostgreSQL instances. For new installations, indexes are created automatically. For existing installations, a new Alembic migration script is provided to apply the indexes seamlessly, ensuring all users benefit from faster filtering and sorting operations. This resolves #15046.Added
chat,tag, andfunctiontables to accelerate common queries.20250619_add_indexes_for_performance.py) that allows existing users to apply the new indexes by runningalembic upgrade head.Changed
Chat,Tag,Function) to declaratively define indexes, ensuring they are created on new installations.Tagmodel was updated to include the new performance index alongside its existing composite primary key, preserving data integrity.Removed
Fixed
Security
Breaking Changes
Additional Information
alembic upgrade headScreenshots or Videos
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.