← Back to Pull requests

[core] Slice lookup changelog rows instead of copying them #1480

Closed
unknown closed this pull request without merging on Nov 27, 2026 07:08 UTC
View on GitHub
unknown unknown commented on Nov 21, 2026 07:07 UTC
Author

Purpose

Linked issue: none, follows #1474

With changelog-producer = lookup, every changelog row is built with take, which copies all of its columns into a new one-row batch, and a key with several changes is concatenated once more. Since #1474 the reader concatenates changelog rows into output batches anyway, so these copies are not needed.

Brief change log

  • source_row returns a one-row slice of the source batch instead of a take copy.

  • A key with a single change returns it as is, without concat_batches.

  • The reader copies its pending changelog rows into one batch whenever it releases source batches, and before handing them on, so a slice never keeps a released batch alive or reaches the writer.
  • PK table, changelog-producer = lookup, compaction time, in-memory FileIO, release build. Measured in one binary with the old path switched back on by env vars, over 3 alternating rounds (parent → this PR):

  • 2M keys, first compaction (every key emits a changelog row): 4028–4051 → 2745–2752 ms

  • 2M keys, a third of them updated, second compaction: 8787–8861 → 7997–8011 ms

  • 64 more BIGINT columns, 500k keys: 12197–12296 → 8059–8119 ms (first), 17211–17442 → 15200–15356 ms (second)

  • 4 KiB values, one changed key per 1,024-row input batch (row-deduplicate, ignore-update-before): 846–851 → 741–764 ms, peak RSS 83–86 → 78–85 MB

  • deletion vectors without a changelog producer, which does not use this path: 5103–5118 vs 5091–5128 ms
  • Tests

  • test_changelog_rows_do_not_keep_released_source_batches: merged source batches are released while changelog rows are pending, and a lone changelog row does not share its source buffer.

  • lookup_changelog_charges_a_lone_row_for_its_own_value: lookup compaction under a 64 KiB memory limit, Parquet and ORC.
  • Both fail without the copy. Ran the ci.yml steps (fmt, clippy, msrv, unit, rest-server, integration, datafusion, python, go).

    API and Format

    None.

    Documentation

    None.

    Diff: 247 lines (+185 / -62) across 3 files Reviewer: JeonDaehong Review duration: 8640m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 247 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.330
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1480"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.4% · Safe to merge
    15.4%