Files
open-webui/backend/open_webui/models
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-02-25 15:15:59 -06:00
2026-03-01 14:06:26 -06:00
2026-02-21 15:35:34 -06:00
2026-02-23 01:40:53 -06:00
2026-02-04 23:42:46 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00
2026-02-25 14:52:41 -06:00
2026-03-01 13:20:55 -06:00
2026-01-09 02:30:15 +04:00
2026-02-21 15:35:34 -06:00
2026-02-19 16:53:21 -06:00
2026-02-11 16:24:11 -06:00
2026-02-21 15:35:34 -06:00
2026-02-21 15:35:34 -06:00
2026-02-16 00:43:32 -06:00
2026-02-23 01:40:53 -06:00
2026-02-13 15:00:39 -06:00