Data UI Backlog

Readable ids as one array parameter (B)

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

A list read sends every id the viewer may read as its own bind parameter: in the page statement and the count statement (filters-for-be-list, lisp/backend.lisp:2323; add-where-clause, 295), once more per reference palette (fast-palette-values, 2101), and in the hydrate statement of an unpaged read (add-ids-clause, 421). The statements therefore grow with the table. Through rbac-query's eval that costs time and memory with the square of the count. Whatever rbac-query does, a statement with 65,536 parameters fails with a cl-postgres PROTOCOL-ERROR, so a type with about 65,500 readable rows cannot be listed at all.

The ask: send the id set as one parameter, <id column> = any($n::uuid[]) with the ids in one {...} array literal, wherever the internal id filter is built: the :id :in filter that filters-for-be-list adds, and add-ids-clause. User-supplied :in filters can keep their placeholders.

Measured through the unchanged eval path, per statement: 58 ms at 7,730 ids, 62 ms at 10,227, 131 ms at 65,535, and 369 ms at 250,000, with the same counts as the placeholder form. With one parameter the compile is constant, so this removes the quadratic cost, the heap exhaustion, and the 65,536 failure by itself, from this repo alone. It is independent of "Direct cl-postgres calls in rbac-query (A)": either one defuses the crash, and both are wanted.

Things a plan must cover:

Slot
7190
Status
60 Done
Tags
mvp, backend, list, perf, db
Contributors
Donnie, Fable-5-2, Grok, Sofia
Plans
Plan: Readable ids as one array parameter (B), Id array parameter - Grok, Id array parameter - Sofia