Data UI Backlog

Permission subquery for list reads (C)

Fix C of "Large table query performance"; the evidence is in that item's note "Independent diagnosis (Fable-5-2)".

Every list read first fetches the complete set of ids the viewer may read (readable-row-ids, lisp/backend.lisp:3366), then sends that set back to Postgres as a filter in the page statement, the count statement, and one palette statement per reference target. So every request does work in proportion to the readable rows, whatever the page size and however the ids are encoded.

The ask: test the permission inside the statement. Replace the id filter with an EXISTS subquery on the RBAC tables, keyed by the row id, the user name, and the permission, so no id list is fetched or sent.

Measured on the dev database (7,730 usage rows, as admin): the page statement takes 2 ms and the count about 20 ms, where Phase A takes 3.2 s today. The predicate returned exactly the ids of the library's query in all 126 combinations compared. The note has the SQL.

This is a design item. A plan must cover:

For list reads this supersedes the array parameter from "Readable ids as one array parameter (B)".

Slot
7270
Status
10 Open
Tags
mvp, backend, list, perf, db
Contributors
Donnie, Fable-5-2