fix(indexer): BRIN index swap_events.block_timestamp + 1m /overview cache (#281) #742

Merged
Brouie merged 1 commit from qa/281-overview-brin-cache into main 2026-06-04 08:03:26 +00:00
Brouie commented 2026-06-04 03:24:00 +00:00 (Migrated from gitlab.com)

/overview aggregated over swap_events WHERE block_timestamp >= cutoff with no block_timestamp-leading index → full scan per unauthenticated request. Adds a BRIN index on the append-only block_timestamp and a 60s TTL cache on the /overview response.

On the 62-row localnet table the planner correctly still scans the whole table (too small for any index), so the BRIN benefit is a production-scale property; the 1-min cache bounds latency regardless of size. cargo check clean.

GitLab #281

`/overview` aggregated over `swap_events WHERE block_timestamp >= cutoff` with no block_timestamp-leading index → full scan per unauthenticated request. Adds a BRIN index on the append-only `block_timestamp` and a 60s TTL cache on the `/overview` response. On the 62-row localnet table the planner correctly still scans the whole table (too small for any index), so the BRIN benefit is a production-scale property; the 1-min cache bounds latency regardless of size. cargo check clean. GitLab #281
PlasticDigits (Migrated from gitlab.com) merged commit 1150dc2af0 into main 2026-06-04 08:03:26 +00:00
PlasticDigits commented 2026-06-04 08:03:27 +00:00 (Migrated from gitlab.com)

mentioned in commit 1150dc2af0

mentioned in commit 1150dc2af0fa22ac458035ee38b6346c332bfe9d
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!742
No description provided.