Skip to content

perf(resolve): fetch candidates from only the files that hold them (#1507) - #1509

Merged
athvin merged 1 commit into
mainfrom
perf/1429-hit-files
Nov 30, 2026
Merged

athvin merged 1 commit into
mainfrom
perf/1429-hit-files

Conversation

@athvin

@athvin athvin commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Closes #1507

Part of #1429. #1429 stays open until er-dev measures p95 under 300 ms.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

The detached candidate fetch opens only the files that hold a candidate and selects the corpus view's own column list. If a hit file lacks one of those columns (schema evolution), it falls back to the full file set, whose union_by_name union has them all.

Why

On er-dev 51e3671e (#1506), the prefilter took 320 ms of a 604 ms resolve (median server total_ms). The fetch read only the candidates' rows, but opened all 15 corpus files on EFS, a network filesystem, per call, although the 46 candidates sit in a few of them.

Proof

  • a_detached_resolve_matches_the_lake_resolve passes.
  • resolve_latency_at_scale still equals the lake resolve on every call.
    • Local SSD: p50 179 / p95 241 ms at 520k on 1 thread, within noise; the gain is EFS's per-file round trips.
  • Resolve tests (8) pass.
  • make check: exit 0.

Risk & rollback

The column-list fallback keeps correctness under schema evolution. Rollback is git revert <merge-sha>.

Post-merge ledger

Closed by: unclosed

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not:
  • images built, or correctly never ran because nothing that goes into
    an image changed:
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion:
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change:
  • the board card reached Done through the automation rather than by
    hand, and the issue closed:
  • follow-ups are open for everything deferred here — numbers:
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned:

Specific to this change

  • er-dev prefilter_ms on p3live after deploy, against 320 ms before:

🤖 Generated with Claude Code

…1507)

er-dev on 51e3671: prefilter 320 ms of a 604 ms resolve. The fetch read only
the candidates' rows, but opened all 15 corpus files on EFS per call.

The detached fetch now opens only the files holding a candidate and selects
the corpus view's own column list. If a hit file lacks one of those columns
(schema evolution), it falls back to the full file set, whose union_by_name
has them all.

a_detached_resolve_matches_the_lake_resolve passes, and
resolve_latency_at_scale still equals the lake resolve on every call (local
SSD: p50 179 / p95 241 ms at 520k on 1 thread, within noise of the previous
run; the gain is EFS's per-file round trips).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
marketing-preview — 6f2a2d59 Deployed Nov 30, 2026 by athvin via remove closed PR previews #201
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.

Resolve's candidate fetch opens every corpus file on EFS (#1429 follow-up)

2 participants