Large table query performance
List reads slow down with the square of the number of rows the viewer may read, whatever the page size. The Admin → Usage tab (10,227 rows) takes 5–6 s per load because a:rbac-query runs each statement through eval, so SBCL compiles postmodern's db:query expansion with one variable per bind parameter, and a list ships every readable id as a parameter in two statements; at about 1,000 rows a day the tab reaches HAProxy's 50 s timeout around mid-December. Unpaged reads (/api/column and the legacy palette path) carry a second cost of the same kind in hydration: 46 s for 7,730 rows in the dev image. In the dev image, with rbac-query calling cl-postgres directly, the usage list fell from 3.05 s to 0.39 s.
The fixes are filed as separate items, in the order to tackle them: "Direct cl-postgres calls in rbac-query (A)", "Readable ids as one array parameter (B)", "Single-pass hydration (D)", and "Permission subquery for list reads (C)".
- Slot
- 7425
- Status
- 60 Done
- Tags
- mvp, backend, list, perf
- Contributors
- Donnie, Sofia