Skip to content

Check file permissions with a single EXISTS query - #2531

Merged
tf merged 1 commit into
codevise:masterfrom
tf:file-policy-exists-query
Nov 18, 2026
Merged

tf merged 1 commit into
codevise:masterfrom
tf:file-policy-exists-query

Conversation

@tf

@tf tf commented Nov 18, 2026

Copy link
Copy Markdown
Member

Authorizing use or management of a file loaded the ids of all entries the user can access and all ids of entries whose revisions use the file. Files that appear in many revisions produce one row per usage, so reusing a handful of such files from another entry took up to 25 seconds in production.

Ask the database whether any accessible entry has a revision using the file instead. It can stop at the first match and no ids need to be transferred.

Authorizing use or management of a file loaded the ids of all entries
the user can access and all ids of entries whose revisions use the
file. Files that appear in many revisions produce one row per usage,
so reusing a handful of such files from another entry took up to 25
seconds in production.

Ask the database whether any accessible entry has a revision using the
file instead. It can stop at the first match and no ids need to be
transferred.
@tf tf added this to the v17.3 milestone Nov 18, 2026
@tf
tf merged commit 538855e into codevise:master Nov 18, 2026
16 checks passed
@tf
tf deleted the file-policy-exists-query branch November 18, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant