Skip to content

Commit

Permalink
Make sure restrict.restrict enables further optimizations down the tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
blambeau committed Oct 5, 2023
1 parent 809ee68 commit ec0147c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

* Optimize `join.restrict`, split predicate and push down the tree.

* Make sure restrict.restrict keeps applying further optimizations down
the tree.

## 0.21.0 - 2023-05-18

* BREAKING: minimal version for ruby is now 2.7. Ruby 2.4 and 2.6 have
Expand Down
2 changes: 1 addition & 1 deletion lib/bmg/operator/restrict.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def to_ast
protected

def _restrict(type, predicate)
Restrict.new(type, @operand, @predicate & predicate)
@operand.restrict(@predicate & predicate)
end

protected ### inspect
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/operator/test_restrict.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module Operator
describe Restrict do

let(:data) {
[
Relation.new([
{ a: 1, b: 2 },
{ a: 11, b: 2 }
]
])
}

subject {
Expand Down

0 comments on commit ec0147c

Please sign in to comment.