Files
open-webui/backend/open_webui/utils
Classic298 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-07-20 22:11:42 -04:00
2026-07-01 02:48:29 -05:00
2026-06-29 11:56:00 -05:00
2026-07-23 04:16:14 -04:00
2026-07-23 12:48:23 -04:00
2026-07-16 01:34:50 -04:00
2026-03-17 17:58:01 -05:00
2026-07-23 02:54:56 -04:00
2026-07-23 02:54:56 -04:00
2026-07-23 12:48:14 -04:00
2026-06-01 13:56:55 -07:00
2026-07-01 03:35:46 -05:00
2026-06-29 13:03:14 -05:00
2026-07-16 01:37:21 -04:00
2026-07-01 02:57:29 -05:00
2026-06-29 00:18:40 -05:00
2026-07-09 17:28:34 -05:00
2026-06-23 23:35:44 +02:00
2026-03-17 17:58:01 -05:00
2026-07-20 22:11:42 -04:00
2026-06-19 00:16:06 +02:00
2026-07-10 18:32:21 -05:00
2026-07-20 22:11:42 -04:00
2026-07-16 00:58:34 -04:00
2026-06-01 13:56:55 -07:00
2026-06-29 12:29:10 -05:00
2026-06-29 13:03:14 -05:00