Skip to content

perf(transaction): resolve a node's local row with one local-table lookup - #1155

Merged
adsharma merged 1 commit into
LadybugDB:mainfrom
aikins01:perf/transaction-local-row-lookup
Oct 9, 2026
Merged

adsharma merged 1 commit into
LadybugDB:mainfrom
aikins01:perf/transaction-local-row-lookup

Conversation

@aikins01

@aikins01 aikins01 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Description

Node-table point lookups check whether an offset is uncommitted with Transaction::isUnCommitted and then compute its local row with getLocalRowIdx. Each of those calls looks up the transaction's local table again, so lookupMultiple pays up to three lookups per row. Transaction::tryGetLocalRowIdx answers both from one getLocalTable call: it returns the row's index in the local table, or nothing when the offset is committed. NodeTable::initScanState, lookup and lookupMultiple now use it, with no change in behavior.

The vector extension's OnDiskEmbeddings::getEmbedding makes the same pair of calls on every embedding read (raised on LadybugDB/extensions#95) and can switch to the helper once this lands.

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Documentation Update

…okup

Checking whether a node offset is uncommitted and then computing its local
row index looked up the transaction's local table up to three times per
row, once in isUnCommitted and again in each getLocalRowIdx call. Node
table lookups and scan-state setup pay this per row on point lookups.

tryGetLocalRowIdx returns the local row index, or nothing when the offset
is committed, from a single getLocalTable call, and NodeTable's
initScanState, lookup, and lookupMultiple use it in place of the pair.
@adsharma
adsharma merged commit 1fb4f55 into LadybugDB:main Oct 9, 2026
4 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.

2 participants