open-webui/backend/open_webui/routers
Classic298 1a3e5ef4c1
perf(prompts): make /tags fetch only the tags column with SQL access filter (#24287)
Non-admin GET /api/v1/prompts/tags went through get_prompts_by_user_id,
which loaded every active prompt with its full content/data/meta plus
owner records and all access grants, then ran one has_access query per
prompt that wasn't owned by the caller - all so the endpoint could
collapse the result to a sorted tag list. With 600 prompts this took
several seconds while the admin path (a single SELECT) returned in <1s.

Add Prompts.get_tags_by_user_id which selects only the tags column and
applies the same EXISTS-based access filter used by /list. Also tighten
the admin get_tags to project just the tags column instead of full rows.
The endpoint is now one DB query (plus one for groups), no row hydration,
no N+1.

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-09 05:20:13 +09:00
..
analytics.py chore: format 2026-04-12 18:12:59 -05:00
audio.py refac 2026-05-09 05:04:51 +09:00
auths.py refac 2026-05-09 01:55:51 +09:00
automations.py refac 2026-04-21 13:46:39 +09:00
calendar.py chore: format 2026-04-21 15:52:00 +09:00
channels.py refac 2026-04-21 15:41:07 +09:00
chats.py fix: stream GET /chats/all to prevent OOM on large chat histories (#24461) 2026-05-09 04:11:52 +09:00
configs.py refac 2026-05-09 02:04:36 +09:00
evaluations.py chore: format 2026-04-12 18:12:59 -05:00
files.py Refactor file processing to use asyncio for transcribing, improving concurrency. (#24379) 2026-05-09 03:17:47 +09:00
folders.py chore: format 2026-04-12 18:12:59 -05:00
functions.py chore: format 2026-04-21 15:52:00 +09:00
groups.py refac: async db 2026-04-12 14:22:11 -05:00
images.py refac 2026-04-17 11:48:17 +09:00
knowledge.py chore: format 2026-04-19 22:45:54 +09:00
memories.py chore: format 2026-04-17 14:28:18 +09:00
models.py refac 2026-05-09 01:21:17 +09:00
notes.py refac 2026-05-09 04:39:44 +09:00
ollama.py refac 2026-05-09 04:17:58 +09:00
openai.py refac 2026-05-09 04:17:58 +09:00
pipelines.py refac 2026-04-20 08:53:06 +09:00
prompts.py perf(prompts): make /tags fetch only the tags column with SQL access filter (#24287) 2026-05-09 05:20:13 +09:00
retrieval.py refac 2026-05-09 04:03:49 +09:00
scim.py refac: async db 2026-04-12 14:22:11 -05:00
skills.py refac: async db 2026-04-12 14:22:11 -05:00
tasks.py refac 2026-05-09 05:14:55 +09:00
terminals.py refac 2026-04-20 08:36:24 +09:00
tools.py chore: format 2026-04-24 18:48:21 +09:00
users.py refac 2026-05-09 01:55:51 +09:00
utils.py refac 2026-04-13 14:08:58 -05:00