You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid fetching the first result page repeatedly in async queries #440
The Node.js kernel backend can retrieve the same first page three times when running an asynchronous query with CloudFetch disabled. These extra transfers add time and network traffic when fetching large results.
How we tested the issue
Used a local build of kernel PR #436, revision 0b5d0edf, with CloudFetch disabled:
SELECT id, sha2(CAST(id AS STRING), 512) AS payload
FROM range(250000) ORDER BY id
Each run consumed and verified all 250,000 rows and 32 MB of payload. After equal warmups, five alternating runs per mode on direct connections measured medians of 4.240 s for Thrift and 4.735 s for kernel (+11.7%). Timing included execution, fetching, and result verification; connection setup was excluded.
A separate request trace showed three copies of the first page, adding about 28.4 MB of response data. A blocking-query control was faster, but it also changes polling behavior, so the full latency difference cannot yet be attributed to duplicate downloads.
What the next investigation / fix should be
Keep the completed response in the shared kernel's asynchronous statement and use it to create the result reader, avoiding another fetch. Status polling currently discards that response and later calls retrieve it again.
Test pagination, concurrent status calls, cancellation, errors, and close behavior. Verify that the first page is retrieved once, then repeat five direct Thrift/kernel runs on the finished implementation against the 10% regression limit.
changed the title [-]Reuse the terminal async response when acquiring results[/-][+]Avoid fetching the first result page repeatedly in async queries[/+]on Nov 12, 2026
Activity
[-]Reuse the terminal async response when acquiring results[/-][+]Avoid fetching the first result page repeatedly in async queries[/+]