Repository navigation
Index active account computers and sparse control log reads - #2046
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Portal loads the account's computers for both
/v1/meand the delete-account dialog. Migration 0113 lets PostgreSQL find active connectors by account and creation time. The query still applies its installation and application joins.Control-only log pulls already filter on
kind <> 1and paginate by sequence. A partial SQLite index on sequence lets workerd seek directly to those records. Existing actors build the index on their next initialization, which requires one scan of the existing item table. The PostgreSQL migration likewise builds its index on existing rows under the migration runner's locking rules.PostgreSQL account computer list
PostgreSQL 18.6, 31 alternating AB/BA pairs after three warmups. Times are server-side execution from
EXPLAIN (ANALYZE, BUFFERS, TIMING OFF). Both arms ran the production query and compared complete ordered results. The fixture includes a revoked connector, a recognized installation, and an installation with an unknown legacy app ID. The large case adds 25,000 connectors across 1,000 other accounts.PostgreSQL kept the sequential scan for the small account. At 25,000 unrelated rows it switched from a sequential scan to a bitmap index scan on
connectors_active_user_created_idx.Durable Object control-only pull
Local workerd with the production SQLite schema, query, filter, and index. Each sample measures 64 byte-limited cursor reads in one request. Latencies and process CPU are batch averages per page. The table reports nearest-rank median and p95 over 15 alternating pairs after three warmups. A separate nine-pair V8 allocation sampling pass included objects collected during each batch. It covers the JS isolate heap. The cursor transferred one 256-byte binary payload per page in both arms.
The SQLite plan changed from
SEARCH items USING INTEGER PRIMARY KEY (rowid>?)toSEARCH items USING INDEX items_control_seq (seq>?). The small fixture shows a slight latency cost. These measurements exercise the storage operations on a local host. Full HTTP and WebSocket behavior is covered separately by conformance.Reproduce
Run from the repository root on Linux with Node 24, Docker and pnpm 11.15.1. The PostgreSQL benchmark creates and drops its own schema.
Validation
pnpm ci:localpassed every selected gate, including package audit.rpnpm --filter @mdbase/connect-server testpassed 1,533 tests. The remote runner skipped 997 tests, including those gated on PostgreSQL.pnpm e2epassed daemon registration, read, disk writes, and sign-out refusal.ephemeral_streams. The same Worker and conformance binary passed with disposable SQLite state on tmpfs.