Skip to content

Where clause optimisation for OR operator#4134

Open
robacourt wants to merge 18 commits intorob/simple-subqueries-with-dnffrom
rob/or-index
Open

Where clause optimisation for OR operator#4134
robacourt wants to merge 18 commits intorob/simple-subqueries-with-dnffrom
rob/or-index

Conversation

@robacourt
Copy link
Copy Markdown
Contributor

@robacourt robacourt commented Apr 20, 2026

Summary

  • optimise OR in the sync-service filter tree
  • split OR branches only when both sides are indexable, otherwise keep the shape once in other_shapes
  • add coverage for OR behaviour, OR cleanup, OR+subquery routing, and raw OR performance
  • remove IN special case as it's now covered by the OR optimisation

Testing

  • mix test test/electric/shapes/filter_test.exs
  • mix test test/electric/shape_cache/shape_status_test.exs

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.24%. Comparing base (801d714) to head (6756d37).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                        Coverage Diff                         @@
##           rob/simple-subqueries-with-dnf    #4134      +/-   ##
==================================================================
+ Coverage                           86.29%   89.24%   +2.95%     
==================================================================
  Files                                  51       25      -26     
  Lines                                3553     2520    -1033     
  Branches                              638      635       -3     
==================================================================
- Hits                                 3066     2249     -817     
+ Misses                                485      269     -216     
  Partials                                2        2              
Flag Coverage Δ
elixir ?
elixir-client ?
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/start 82.83% <ø> (ø)
packages/typescript-client 94.36% <ø> (+0.05%) ⬆️
packages/y-electric 56.05% <ø> (ø)
typescript 89.24% <ø> (+0.03%) ⬆️
unit-tests 89.24% <ø> (+2.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robacourt robacourt changed the title Index OR predicates in filter Where clause optiomisation for OR operator Apr 20, 2026
@robacourt robacourt changed the title Where clause optiomisation for OR operator Where clause optimisation for OR operator Apr 20, 2026
@robacourt robacourt requested a review from icehaunter April 20, 2026 09:51
@robacourt robacourt force-pushed the rob/or-index branch 2 times, most recently from 99059c4 to fb15c7b Compare April 22, 2026 09:45
@robacourt robacourt force-pushed the rob/or-index branch 2 times, most recently from fb15c7b to 6756d37 Compare April 22, 2026 12:58
@robacourt robacourt force-pushed the rob/simple-subqueries-with-dnf branch from 801d714 to ec39d48 Compare April 23, 2026 16:47
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