Files
open-webui/backend/open_webui/models
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-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-19 22:45:54 +09:00
2026-04-21 15:52:00 +09:00
2026-05-05 04:21:23 +09:00
2026-05-09 03:19:48 +09:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-12 14:22:11 -05:00
2026-04-12 18:12:59 -05:00
2026-04-24 18:48:21 +09:00
2026-05-09 04:39:44 +09:00
2026-04-24 18:48:21 +09:00
2026-04-12 14:22:11 -05:00
2026-04-17 14:28:18 +09:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:49:34 -05:00