Repository navigation
perf(resolve): a cached session per dataset and a blocking prefilter, ~5x faster at 520k (#1429) - #1476
Merged
Conversation
… ~5x faster at 520k (#1429) POST …/resolve took p50 2092 ms / p95 2199 ms at ~520k standardized records on er-dev (#1365). Every call opened a lake session, read the TF CSV, and copied the whole corpus through materialize_concat to block one probe against it. - er-server: resolve_blocking keeps one session and its er_cli::ResolveCache per dataset lake env (RESOLVE_SESSIONS). A publish changes the key; a failed resolve drops its session; calls serialize per dataset. This is only for a postgres: catalog; a DuckDB-file catalog's process lock would shut the writer out, so those lakes still open per request. - er_cli::resolve_record_cached and ResolveCache: the frozen TF tables are cached by CSV path, model version and TF snapshot. The corpus's record_key plus the blocking rules' columns are cached by lake snapshot. Every rule in both orientations selects the records that can pair with the probe, and only those are read and scored. Blocking already limited the pairs, and the TF is frozen, so the answer is unchanged. Array-exploding rules skip the prefilter. - The probe is standardized with only its own source declared. - resolve_record keeps its signature (a fresh cache). std_corpus moves above resolve_record's doc, which #1368 had separated from the function. Measured by the new ignored resolve_latency_at_scale test at 519,984 synthetic records with distinct blocking keys: p50 1414 to 295 ms, p95 1639 to 340 ms. Every cached call matches the uncached first call. Before and after are in the er-server-control-plane reference. er-dev, where the per-request lake attach and object-store reads also go away, is measured after deploy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 30, 2026 05:20 — with
GitHub Actions
Inactive
athvin
added a commit
that referenced
this pull request
Nov 30, 2026
…e scan for one-off calls (#1429) (#1482) #1476 made no difference on er-dev, and its p95 got worse (p50 about 2.2 s, p95 3.9 to 7.8 s). Provisioning writes ER_LAKE_CATALOG as ducklake:postgres:..., and resolve_session_cacheable accepted only postgres:, so er-dev never kept a session. Every call then took the one-off path, which in #1476 scanned the S3 corpus twice: once to build the key table and again to fetch candidates. - resolve_session_cacheable accepts ducklake:postgres: as well as postgres:. A unit test pins the provisioned form. - ResolveCache::persistent() marks a cache that outlives the call; the server uses it. A one-off cache (resolve_record) filters the lake corpus directly in one scan, as before #1476's key table. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was previously deployed
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.
Closes #1429
What
resolve_blockingkeeps one session and itser_cli::ResolveCacheper dataset lake env (RESOLVE_SESSIONS).postgres:catalog. A DuckDB-file catalog's process lock would shut the writer out (seen inpg_launch_proof), so those lakes still open per request.er_cli::resolve_record_cachedandResolveCache.record_keyplus the blocking rules' columns are cached in memory by lake snapshot.resolve_recordkeeps its signature by passing a fresh cache.std_corpusmoves aboveresolve_record's doc comment, which Account datasets: match-preview and blocking-estimate read only int_std_records #1368 had separated from its function.resolve_latency_at_scale(er-cli).Why
At about 520k records, resolve took p50 2092 ms and p95 2199 ms on er-dev (#1365). Every call opened a lake session, read the TF CSV, and copied the whole standardized corpus through
materialize_concatto block a single probe against it.Proof
resolve_latency_at_scaleat 519,984 synthetic records with distinct blocking keys, 20 timed calls after 5 warm-ups (loaded machine, ±50 ms):acct_tests (12) pass, andpg_launch_proof(HTTP resolve, three calls) passes.make check: exit 0.The ticket's target is measured on er-dev after deploy, where the per-request lake attach and the object-store corpus scan also go away. The numbers will go in the ledger.
Risk & rollback
git revert <merge-sha>.Post-merge ledger
Closed by: unclosed
mainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
imagesbuilt, or correctly never ran because nothing that goes intoan image changed:
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion:
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change:
Donethrough the automation rather than byhand, and the issue closed:
(a skill, a reference, memory) — or nothing new was learned:
Specific to this change
🤖 Generated with Claude Code