Files
open-webui/backend/open_webui/utils
Classic298 dbf715cb63 perf: stop scanning every skill on each listing and chat turn (#28798)
Listing skills ran one database query per skill in the instance. A non-admin opening the list on a workspace with 500 skills issued over 500 queries, the paginated list re-resolved the caller's group membership once per row, and every chat message carrying a skill loaded every skill the user can read, full body and owner included, to use the two or three it actually referenced.

Skills now arrive already filtered: the owner-or-grant check runs in the query as an EXISTS subquery, the same way prompts and the search endpoints already do it, the per-item write flag uses the existing batch grant lookup, and the chat path asks only for the skill ids the request names.

Measured with 500 skills of which 3 are visible to the caller: 504 queries and ~300 ms before, 4 queries and ~2.6 ms after. The resulting set is unchanged for owner, public, direct-user, group and multi-grant entries, for both read and write.
2026-08-19 11:07:33 -07:00
..
2026-06-29 11:56:00 -05:00
2026-07-31 17:41:14 -04:00
2026-08-13 21:02:17 -06:00
2026-08-13 16:42:10 -06:00
2026-07-31 17:30:47 -04:00
2026-03-17 17:58:01 -05:00
2026-07-23 02:54:56 -04:00
2026-07-26 21:12:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:41:14 -04:00
2026-08-17 00:57:57 -07:00
2026-07-23 21:29:33 -04:00
2026-07-27 00:12:47 -04:00
2026-08-10 19:28:21 -06:00
2026-07-26 23:09:22 -04:00
2026-08-13 00:07:31 -06:00
2026-07-27 19:39:36 -04:00
2026-08-16 22:56:19 -07:00
2026-08-17 00:57:57 -07:00
2026-03-17 17:58:01 -05:00
2026-07-27 04:17:00 -04:00
2026-08-10 20:13:03 -06:00
2026-06-19 00:16:06 +02:00
2026-08-08 15:47:10 -06:00
2026-08-16 22:52:24 -07:00
2026-07-27 19:39:36 -04:00
2026-07-31 17:41:14 -04:00