feat(zql): batch flip join requests - #5928
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| Branch | mlaw/flip-in |
| Testbed | Linux |
Click to view all benchmark results
| Benchmark | File Size | Benchmark Result kilobytes (KB) (Result Δ%) | Upper Boundary kilobytes (KB) (Limit %) |
|---|---|---|---|
| zero-package.tgz | 📈 view plot 🚷 view threshold | 2,110.91 KB(+0.04%)Baseline: 2,110.04 KB | 2,152.24 KB (98.08%) |
| zero.js | 📈 view plot 🚷 view threshold | 279.48 KB(-0.13%)Baseline: 279.83 KB | 285.43 KB (97.91%) |
| zero.js.br | 📈 view plot 🚷 view threshold | 74.21 KB(-0.09%)Baseline: 74.28 KB | 75.76 KB (97.95%) |
|
| Branch | mlaw/flip-in |
| Testbed | self-hosted-metal |
Click to view all benchmark results
| Benchmark | Throughput | Benchmark Result operations / second (ops/s) (Result Δ%) | Lower Boundary operations / second (ops/s) (Limit %) |
|---|---|---|---|
| src/db/pg-copy.bench.ts > pg-copy benchmark > copy | 📈 view plot 🚷 view threshold | 18.01 ops/s(+0.09%)Baseline: 17.99 ops/s | 17.56 ops/s (97.52%) |
|
| Branch | mlaw/flip-in |
| Testbed | self-hosted-metal |
Click to view all benchmark results
| Benchmark | Throughput | Benchmark Result operations / second (ops/s) x 1e3 (Result Δ%) | Lower Boundary operations / second (ops/s) x 1e3 (Limit %) |
|---|---|---|---|
| src/client/custom.bench.ts > big schema | 📈 view plot 🚷 view threshold | 35.96 ops/s x 1e3(+1.76%)Baseline: 35.34 ops/s x 1e3 | 33.37 ops/s x 1e3 (92.81%) |
| src/client/zero.bench.ts > basics > All 1000 rows x 10 columns (numbers) | 📈 view plot 🚷 view threshold | 1.11 ops/s x 1e3(+1.15%)Baseline: 1.10 ops/s x 1e3 | 1.04 ops/s x 1e3 (93.85%) |
| src/client/zero.bench.ts > pk compare > pk = N | 📈 view plot 🚷 view threshold | 19.08 ops/s x 1e3(-0.47%)Baseline: 19.17 ops/s x 1e3 | 16.58 ops/s x 1e3 (86.91%) |
| src/client/zero.bench.ts > with filter > Lower rows 500 x 10 columns (numbers) | 📈 view plot 🚷 view threshold | 1.50 ops/s x 1e3(-1.01%)Baseline: 1.51 ops/s x 1e3 | 1.33 ops/s x 1e3 (88.96%) |
|
| Branch | mlaw/flip-in |
| Testbed | self-hosted-metal |
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
🚨 4 Alerts
🐰 View full continuous benchmarking report in Bencher
tantaman
marked this pull request as ready for review
May 13, 2026 19:13
tantaman
commented
May 14, 2026
| @@ -42,7 +42,7 @@ describe('Chinook planner execution cost validation', () => { | |||
| extraIndexValidations: [ | |||
Contributor
Author
There was a problem hiding this comment.
most of all the planner statistics got better which is good news.
tantaman
commented
May 14, 2026
Comment on lines
+58
to
+59
| expect(pick(ast, ['where', 'conditions', 0, 'flip'])).toBe(false); | ||
| expect(pick(ast, ['where', 'conditions', 1, 'flip'])).toBe(true); |
Contributor
Author
There was a problem hiding this comment.
hmm, why would we flip genre over album now? Maybe costs are about equal so it just picks one at random?
Member
There was a problem hiding this comment.
This flip cost change caused planner benchmarks to regress 30x.
tantaman
commented
May 14, 2026
| // SCAN are now amortized across one combined IN-list query. | ||
| // Tightened from -0.5 / 10 / 10. | ||
| ['correlation', 0.9], | ||
| ['within-optimal', 1], |
Contributor
Author
There was a problem hiding this comment.
wow, this is a big win!
tantaman
commented
May 14, 2026
| ['within-optimal', 1.4], | ||
| // Tightened from -1 / 1.4 after multi-IN AND propagation lets | ||
| // the source filter both join keys in one query. | ||
| ['correlation', 0.9], |
Treat merge-sort as the canonical FlippedJoin fetch path. Drops #fetchQuicksort, the #parentKeyIsUnique branch, and the now-unused SourceSchema.uniqueIndexes plumbing through TableSource. Merge-sort already groups child→parent lookups by parent-key value, so the unique-key shortcut no longer earns its complexity. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Uses `WHERE IN (...)` so flip-join fetches BATCH_SIZE keys at once. This gives Goblin's "school administrator viewing students" query a 6x speedup. (cherry picked from commit b94ff72)
tantaman
enabled auto-merge
May 14, 2026 17:08
Contributor
Author
|
🤔I recall them all getting faster
…On Thu, Jun 25, 2026 at 6:31 PM Chase Adams ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/zql-integration-tests/src/chinook/planner.pg.test.ts
<#5928 (comment)>:
> + expect(pick(ast, ['where', 'conditions', 0, 'flip'])).toBe(false);
+ expect(pick(ast, ['where', 'conditions', 1, 'flip'])).toBe(true);
This flip cost change caused planner benchmarks to regress 30x.
—
Reply to this email directly, view it on GitHub
<#5928?email_source=notifications&email_token=AAHWK26P6HXOBFAIWWWJHUD5BWR3TA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINJXGU2DMMZQGU42M4TFMFZW63VMON2GC5DFL5RWQYLOM5S2KZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#discussion_r3478065529>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHWK23XTZQMNTZTJNIBV4L5BWR3TAVCNFSNUABFKJSXA33TNF2G64TZHM2TSOJUGE2DSMJYHNEXG43VMU5TINBQGA4DSMBYGI4KC5QC>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.