open-webui/backend/open_webui/models
Classic298 baef422a28
perf: eliminate redundant query after memory update (#21013)
## Summary
Eliminates redundant database query in update_memory_by_id_and_user_id. Previously, after modifying the memory object, it called get_memory_by_id which opened a new session and queried again.
## Changes
models/memories.py update_memory_by_id_and_user_id:
- Replace self.get_memory_by_id(id) with db.refresh(memory)
- Return the same memory object that was already modified
## Performance Impact
Before: 2 queries (get + get_memory_by_id)
After: 1 query + refresh on same session
2026-01-29 21:45:09 +04:00
..
auths.py chore: format 2026-01-08 01:55:56 +04:00
channels.py chore: format 2026-01-09 02:46:04 +04:00
chats.py enh: manage shared chats 2026-01-29 18:51:02 +04:00
feedbacks.py perf: optimize database queries in functions, feedbacks, and groups (#21019) 2026-01-29 21:44:50 +04:00
files.py enh: files data controls 2026-01-29 19:50:06 +04:00
folders.py chore: format 2026-01-08 01:55:56 +04:00
functions.py perf: optimize database queries in functions, feedbacks, and groups (#21019) 2026-01-29 21:44:50 +04:00
groups.py perf: optimize database queries in functions, feedbacks, and groups (#21019) 2026-01-29 21:44:50 +04:00
knowledge.py refac 2026-01-22 03:09:04 +04:00
memories.py perf: eliminate redundant query after memory update (#21013) 2026-01-29 21:45:09 +04:00
messages.py feat: channel webhooks 2026-01-09 02:30:15 +04:00
models.py fix: reduce triple query to single fetch in model toggle (#21009) 2026-01-29 17:24:09 +04:00
notes.py chore: format 2026-01-08 01:55:56 +04:00
oauth_sessions.py chore: format 2026-01-08 01:55:56 +04:00
prompt_history.py wip: prompt history models 2026-01-24 02:39:29 +04:00
prompts.py refac: prompts pagination 2026-01-27 23:01:56 +04:00
tags.py chore: format 2026-01-08 01:55:56 +04:00
tools.py chore: format 2026-01-08 01:55:56 +04:00
users.py perf: eliminate redundant SELECT after UPDATE in users.py (#21011) 2026-01-29 17:22:28 +04:00