Class: Veritas::Optimizer::Algebra::Join::EqualHeaders

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

Overview

Optimize when operands’ headers are equal

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 operands’ headers are equal to the join’s headers

Returns:

  • (Boolean)


42
43
44
# File 'lib/veritas/optimizer/algebra/join.rb', line 42

def optimizable?
  left.header.eql?(right.header)
end

#optimizeAlgebra::Intersection

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.

A Join with an equal header is an Intersection



51
52
53
# File 'lib/veritas/optimizer/algebra/join.rb', line 51

def optimize
  left.intersect(right)
end