Class: Axiom::Optimizer::Algebra::Join::MaterializedLeft

Inherits:
Axiom::Optimizer::Algebra::Join show all
Defined in:
lib/axiom/optimizer/algebra/join.rb

Overview

Optimize when the left operand is materialized

Constant Summary

Constants inherited from Axiom::Optimizer::Algebra::Join

CONTRADICTION

Constants inherited from Axiom::Optimizer

Identity, VERSION

Instance Attribute Summary

Attributes included from Function::Binary

#left, #right

Attributes inherited from Axiom::Optimizer

#operation

Instance Method Summary collapse

Methods included from Function::Binary

#initialize

Methods inherited from Axiom::Optimizer

chain, #initialize

Instance Method Details

#optimizable?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if the left operand is materialized

Returns:

  • (Boolean)


90
91
92
# File 'lib/axiom/optimizer/algebra/join.rb', line 90

def optimizable?
  left.materialized? && !right_matching_left?
end

#optimizeAlgebra::Join

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return the join of the left and right with the right restricted

Returns:



99
100
101
# File 'lib/axiom/optimizer/algebra/join.rb', line 99

def optimize
  left.join(right.restrict(materialized_predicate))
end