Files
open-webui/backend/open_webui
Classic298andClaude e64acf1c0a perf: batch and deduplicate per-request DB reads in the chat middleware (#27223)
Several spots in the chat pipeline issued sequential single-key config
SELECTs, or fetched the same key twice back-to-back, on every request:

- chat_completion_tools_handler: task model default/external and the
  tools prompt template were four sequential Config round trips (the
  template was fetched twice). One batched Config.get_many now serves
  all of them.
- chat_completion_files_handler: the six RAG settings (top_k,
  top_k_reranker, relevance_threshold, hybrid_bm25_weight,
  enable_hybrid_search, full_context) were six sequential round trips
  inside the retrieval call. Batched into one get_many.
- Voice and code-interpreter prompt templates were each fetched twice
  within one conditional; fetch once and reuse. The code-interpreter
  engine was likewise fetched twice per execution.
- Skill resolution fetched the accessible-skills list, kept only the
  ids, then re-fetched each mentioned skill by id (N+1). Reuse the
  rows from the access query.

Value semantics are identical: get_many applies the same defaults as
the individual gets, and the pre-existing truthiness/empty-string
checks on templates are preserved exactly.


Claude-Session: https://claude.ai/code/session_01MHg5zs1VBjvRWQ54qHpfYD

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-23 13:21:29 -05:00
..
2026-06-29 12:40:20 -05:00
2026-07-23 13:41:16 -04:00
2026-07-23 13:41:16 -04:00
2026-07-23 13:41:16 -04:00
2026-07-20 22:27:13 -04:00
2026-07-23 03:39:30 -04:00
2026-06-17 03:01:11 +02:00
2026-07-14 17:34:00 -04:00
2026-06-29 05:46:51 -05:00
2026-07-09 17:28:05 -05:00
2026-07-23 03:39:56 -04:00
2026-07-23 04:16:14 -04:00
2026-07-16 21:57:43 -04:00