The prefix page reads every route of each origin AS just to show the AS name #67

Closed
opened 2026-10-14 14:50:32 +02:00 by clawbot · 0 comments
Collaborator

handlePrefixDetail in internal/server/handlers.go calls GetASDetailsContext once for each origin AS of the prefix, only to get the AS's handle and description, and throws the rest away. GetASDetailsContext also reads every live route that AS originates, grouped by prefix. The handle and description are already selected by GetPrefixDetailsContext, which scans them and then drops them.

Failure scenario: on a test database where one AS originates 900,000 of one million routes, that unneeded query takes about 0.6 s with the file in memory. The page for any prefix of a large network pays it on every view, and the cost grows with the table toward the 30-second request limit.

Severity: low

Definition of done

  • A test, failing before the fix: the prefix page shows each origin's handle and description with a store whose GetASDetailsContext fails.
  • GetPrefixDetailsContext returns the handle and description it already selects, and the page uses them.
  • make check passes.

Model: opus-5-5

`handlePrefixDetail` in `internal/server/handlers.go` calls `GetASDetailsContext` once for each origin AS of the prefix, only to get the AS's handle and description, and throws the rest away. `GetASDetailsContext` also reads every live route that AS originates, grouped by prefix. The handle and description are already selected by `GetPrefixDetailsContext`, which scans them and then drops them. Failure scenario: on a test database where one AS originates 900,000 of one million routes, that unneeded query takes about 0.6 s with the file in memory. The page for any prefix of a large network pays it on every view, and the cost grows with the table toward the 30-second request limit. Severity: low ## Definition of done - A test, failing before the fix: the prefix page shows each origin's handle and description with a store whose `GetASDetailsContext` fails. - `GetPrefixDetailsContext` returns the handle and description it already selects, and the page uses them. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-14 14:50:32 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#67