Materialise the trade summary row for very large lists

Table of Contents

This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.

1. What

Store the trade summary row in a table, kept up to date by the booking path or by triggers, when a tenant outgrows the view. The table takes a trigram index on the search text and pages in milliseconds.

2. Why

The trade summary is a view. A view cannot push the page limit below the sort, so every page builds every row. At 102,432 trades the page takes about 4 s and an identifier search about 2.7 s, which is about 37 microseconds a trade. The view is fine up to about 20,000 trades for each tenant. A stored row removes the limit, and it costs a table to keep consistent with six sources, a backfill and change events. Take this capture when a tenant holds more than about 20,000 live trades, or when a screen needs a faster page.

3. References

4. See also

Emacs 29.3 (Org mode 9.6.15)