Skip to content

fix: index http_transactions.container_name to speed up pending page#55

Merged
tito merged 2 commits into
GreyhavenHQ:mainfrom
apre:fix/pending-page-http-transactions-index
Jun 2, 2026
Merged

fix: index http_transactions.container_name to speed up pending page#55
tito merged 2 commits into
GreyhavenHQ:mainfrom
apre:fix/pending-page-http-transactions-index

Conversation

@apre
Copy link
Copy Markdown
Contributor

@apre apre commented Jun 2, 2026

Disclaimer: PR coded by claude code, I don’t understand code and implications.
but it works on my setup.

thank you !

warning, bellow this line it’s slop (measured time are confirmed).

The pending page's container filter runs SELECT DISTINCT container_name across pending_requests, request_logs, and http_transactions. The first two are indexed; http_transactions was not, forcing a full scan of a BLOB-heavy table (~170k rows, the bulk of a 20 GB database). On a DB this size, GET /pending took ~10s. Adding the index drops it to sub-second (measured 11.8s -> 0.74s cold, 0.016s warm).

The pending page's container filter runs SELECT DISTINCT container_name
across pending_requests, request_logs, and http_transactions. The first
two are indexed; http_transactions was not, forcing a full scan of a
BLOB-heavy table (~170k rows, the bulk of a  20 GB database).
On a DB this size, GET /pending took ~10s. Adding the index drops it to
sub-second (measured 11.8s -> 0.74s cold, 0.016s warm).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@apre apre force-pushed the fix/pending-page-http-transactions-index branch from 2ef28fb to 3abc135 Compare June 2, 2026 07:45
@tito
Copy link
Copy Markdown
Contributor

tito commented Jun 2, 2026

Can you fix the CI/tests related to migration as well ? I'm happy to merge. This is not slop looking don't worry.

The new idx_http_transactions_container migration brings the total to
15, but TestMigrations still asserted 14. Update the expected count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tito tito merged commit 017a3a7 into GreyhavenHQ:main Jun 2, 2026
@tito
Copy link
Copy Markdown
Contributor

tito commented Jun 2, 2026

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants