Files
open-webui/backend/open_webui/utils
Classic298 d93cb3658d perf(models): batch-fetch function valves to eliminate N+1 queries (#22301)
* perf(models): batch-fetch function valves to eliminate N+1 queries

get_action_priority() called Functions.get_function_valves_by_id()
individually for every action on every model — an N+1 query pattern
that issued one DB round-trip per (action x model) pair.

Add Functions.get_function_valves_by_ids() that fetches all valves in
a single WHERE IN query, then look up each action's valves from the
pre-fetched dict inside get_action_priority().

No functional change — same priority resolution, same sort order.

* Update models.py

* Update models.py
2026-03-06 15:56:01 -06:00
..
2026-03-02 17:26:18 -06:00
2026-02-11 16:40:40 -06:00
2026-02-21 15:35:34 -06:00
2026-02-11 16:24:11 -06:00
2026-02-19 16:29:19 -06:00
2026-02-16 15:32:28 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00
2026-01-28 01:18:39 +04:00
2025-12-29 00:21:18 +04:00
2026-02-06 03:23:37 +04:00
2026-03-06 15:42:13 -06:00
2026-02-27 16:03:12 -06:00
2026-02-24 17:04:07 -06:00
2026-02-22 17:11:50 -06:00
2026-02-21 15:35:34 -06:00
2025-12-02 03:52:38 -05:00
2026-02-23 18:23:34 -06:00
2026-02-11 16:24:11 -06:00
2026-02-24 14:47:28 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00
2026-01-08 00:42:29 +04:00