Files
open-webui/backend/open_webui
Classic298andClaude 41107a34ca perf(prompts): filter prompt list in SQL instead of N+1 has_access loop (#24288)
get_prompts_by_user_id used to fetch every active prompt (with users +
all access grants), then call AccessGrants.has_access() once per prompt
that the user did not own. With 600+ prompts this issued ~600 extra
round-trips per request and explained the multi-second delay reported in
the GET /api/v1/prompts and /api/v1/prompts/tags endpoints for non-admin
users.

Push the access check into a single SQL query via the existing
AccessGrants.has_permission_filter (EXISTS subquery), so only accessible
rows come back from the DB. Users and access grants for the surviving
rows are still batch-fetched, no N+1 anywhere on this path.

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-09 05:12:51 +09:00
..
…
2026-05-09 02:38:08 +09:00
2026-05-09 04:39:44 +09:00
2026-05-09 04:49:18 +09:00
2026-05-09 05:04:51 +09:00
2026-05-09 03:15:53 +09:00
2026-04-19 22:45:54 +09:00
2026-04-12 19:08:30 -05:00
2026-03-17 17:58:01 -05:00
2026-05-09 03:15:53 +09:00
2026-05-09 02:38:08 +09:00
2026-05-09 02:54:09 +09:00
2026-04-14 17:27:31 -05:00
2026-04-24 16:23:28 +09:00
2026-05-09 04:17:58 +09:00
2026-05-09 03:45:56 +09:00
2026-03-17 17:58:01 -05:00