GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — perf: avoid flattening and shifting result batches by vuanhphung · Pull Request #577 · databricks/databricks-sql-nodejs

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Before: ResultSlicer accumulated provider batches to fill the requested chunk (100,000 rows by default), removed the needed prefix with splice(), retained the tail, and joined pieces with flat(). Repeated fetches shifted the leftover rows; fetchAll() also used flat().

After: Keep the batch and advance an offset, taking requested rows with slice(). Compact the tail after more than half is consumed to release row references without repeatedly copying a large tail. Reuse a single piece directly, or join multiple pieces with a copy loop shared by fetchAll(); cap initial allocation to avoid V8 dictionary arrays. Chunk sizes, order, and buffering behavior stay the same.

Validation: 1,548 unit tests, lint, formatting, type checking, and build pass. Offline 80M-row Arrow pipeline: 29.7 → 13.8 ns/row.

Live kernel benchmark on pecotesting (Medium serverless), result caching and row materialization disabled, 100,000-row chunks. Medians of five fresh-process samples per build after warmup; all row counts matched.

Query Elapsed, main → PR Drain, main → PR
Boolean, 80M rows 3.602 → 2.625 s 2.527 → 1.457 s
Float, 50M rows 4.724 → 4.149 s 1.632 → 1.001 s
Double, 30M rows 4.724 → 4.004 s 1.068 → 0.651 s

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vuanhphung
perf: avoid flattening and shifting result batches
b77e314
Signed-off-by: Vu Anh Phung <[email protected]>
@vuanhphung vuanhphung added the ai-assisted label Nov 11, 2026
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 06:56 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 06:56 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 06:56 — with GitHub Actions Inactive
peco-review-bot[bot]
peco-review-bot Bot approved these changes Nov 11, 2026
View reviewed changes

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vuanhphung
perf: keep large result joins fast and preserve limit handling
0a0b576
Signed-off-by: Vu Anh Phung <[email protected]>
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 16:23 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 16:23 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 16:23 — with GitHub Actions Inactive
peco-review-bot[bot]
peco-review-bot Bot approved these changes Nov 11, 2026
View reviewed changes

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vuanhphung
fix: release consumed result rows and normalize buffered limits
9084370
Signed-off-by: Vu Anh Phung <[email protected]>
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 18:43 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 18:43 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 18:43 — with GitHub Actions Inactive
peco-review-bot[bot]
peco-review-bot Bot approved these changes Nov 11, 2026
View reviewed changes

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Nit

Looks good, no blocking issues. I compared the new offset-based ResultSlicer with the old splice/flat logic for leftovers, exact fits, fractional limits, NaN, zero and negative limits, undefined limits, unbuffered mode and the concatChunks growth past 2**25, and the results match. One benign difference: concatChunks now keeps holes as undefined where flat() dropped them; no current source produces sparse chunks.

Other findings

  • ⚪ Nit — The new CHANGELOG entry has no PR reference. Neighbouring entries end with one (for example (#471)), so this one should end with (#577).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

This branch was previously deployed

1 inactive deployment
azure-prod — 90843705 Deployed Nov 11, 2026 by vuanhphung via e2e-test (24.22.1, 24_22_1) #1854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@peco-review-bot peco-review-bot[bot] peco-review-bot[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ai-assisted

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@vuanhphung
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.