open-webui/backend/open_webui
Claude 576fc39e99
perf(prompts): filter prompt list in SQL instead of N+1 has_access loop
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.
2026-05-01 06:31:40 +00:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal chore: format 2026-04-21 15:52:00 +09:00
migrations refac 2026-04-21 14:58:28 +09:00
models perf(prompts): filter prompt list in SQL instead of N+1 has_access loop 2026-05-01 06:31:40 +00:00
retrieval refac 2026-04-21 16:04:48 +09:00
routers chore: format 2026-04-21 15:52:00 +09:00
socket refac 2026-04-17 13:29:51 +09:00
static chore: format 2026-04-19 22:45:54 +09:00
storage refac 2026-04-12 19:08:30 -05:00
test refac 2026-03-17 17:58:01 -05:00
tools refac 2026-04-21 13:46:39 +09:00
utils refac 2026-04-21 16:05:26 +09:00
__init__.py refac (#22987) 2026-03-24 15:41:26 -05:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py chore: format 2026-04-19 22:45:54 +09:00
constants.py chore: format 2026-04-14 17:27:31 -05:00
env.py refac 2026-04-20 09:21:30 +09:00
functions.py refac 2026-04-21 14:31:04 +09:00
main.py refac 2026-04-20 08:53:06 +09:00
tasks.py refac 2026-03-17 17:58:01 -05:00