Skip to content

[core] Downcast sequence and kind columns once per merge batch - #1193

Merged
JingsongLi merged 1 commit into
apache:mainfrom
JeonDaehong:perf-sort-merge-cursor-columns
Oct 22, 2026
Merged

JingsongLi merged 1 commit into
apache:mainfrom
JeonDaehong:perf-sort-merge-cursor-columns

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #1192

Brief change log

SortMergeCursor keeps the typed _SEQUENCE_NUMBER and _VALUE_KIND arrays, downcast once per batch, instead of looking them up for every emitted row. A NULL or missing _VALUE_KIND still reads as INSERT.

PK merge of 2M keys × 3 overlapping rounds: 445–455 → 414–427 ms (medians over 8 alternating rounds on one instance). DV merge-on-read: 446–451 → 412–427 ms.

Tests

Covered by the existing sort-merge and KV reader tests.

Ran the ci.yml steps locally (fmt, clippy, msrv, unit, rest-server, integration, datafusion, python, go).

API and Format

None.

Documentation

None.

SortMergeCursor looked up and downcast _SEQUENCE_NUMBER and _VALUE_KIND on
every row it emitted. Keep the typed arrays on the cursor instead.
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

@JingsongLi a small one in the same merge loop as #1162. PTAL when you have time.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 953dcb5 into apache:main Oct 22, 2026
15 of 16 checks passed
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.

Downcast _SEQUENCE_NUMBER and _VALUE_KIND once per batch in sort merge

2 participants