open-webui/backend/open_webui
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
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refac/fix: DATABASE_ENABLE_SESSION_SHARING env var 2026-01-10 00:16:04 +04:00
migrations enh: prompt tags 2026-01-26 16:11:10 +04:00
models perf: eliminate redundant query after memory update (#21013) 2026-01-29 21:45:09 +04:00
retrieval Yandex web search (#20922) 2026-01-26 07:31:44 -05:00
routers fix: resolve N+1 query in SCIM group_to_scim user lookup (#21005) 2026-01-29 21:43:33 +04:00
socket chore: format 2026-01-08 01:55:56 +04:00
static refac 2025-08-10 00:02:58 +04:00
storage chore/perf: Remove old SRC level log env vars with no impact (#20045) 2025-12-20 08:16:14 -05:00
test rm: outdated tests 2025-12-28 23:35:09 +04:00
tools refac 2026-01-27 21:37:20 +04:00
utils REDIS_RECONNECT_DELAY as positive float for handle retry delay on timeout/connection errors (#21021) 2026-01-29 17:13:03 +04:00
__init__.py Update __init__.py 2025-04-15 09:55:35 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py Yandex web search (#20922) 2026-01-26 07:31:44 -05:00
constants.py feat/enh: optional password validation 2025-11-20 17:44:49 -05:00
env.py REDIS_RECONNECT_DELAY as positive float for handle retry delay on timeout/connection errors (#21021) 2026-01-29 17:13:03 +04:00
functions.py chore/perf: Remove old SRC level log env vars with no impact (#20045) 2025-12-20 08:16:14 -05:00
main.py Yandex web search (#20922) 2026-01-26 07:31:44 -05:00
tasks.py chore/perf: Remove old SRC level log env vars with no impact (#20045) 2025-12-20 08:16:14 -05:00