Class: Veritas::Optimizer::Algebra::Join::RightMaterializedOperand

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

Overview

Optimize when the right operand is materialized

Constant Summary

Constants inherited from Veritas::Optimizer::Algebra::Join

CONTRADICTION

Constants inherited from Veritas::Optimizer

Noop, VERSION

Instance Attribute Summary

Attributes included from Function::Binary

#left, #right

Attributes inherited from Veritas::Optimizer

#operation

Instance Method Summary collapse

Methods included from Function::Binary

#initialize

Methods inherited from Veritas::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 right operand is materialized

Returns:

  • (Boolean)


132
133
134
# File 'lib/veritas/optimizer/algebra/join.rb', line 132

def optimizable?
  right.materialized? && ! left_matching_right?
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 left restricted

Returns:



141
142
143
# File 'lib/veritas/optimizer/algebra/join.rb', line 141

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