Class: Axiom::Optimizer::Algebra::Join::DisjointHeaders

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

Overview

Optimize when operands’ headers are disjoint

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 operands’ headers are disjoint

Returns:

  • (Boolean)


67
68
69
# File 'lib/axiom/optimizer/algebra/join.rb', line 67

def optimizable?
  (left.header & right.header).none?
end

#optimizeAlgebra::Product

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 disjoint headers is a Product

Returns:



76
77
78
# File 'lib/axiom/optimizer/algebra/join.rb', line 76

def optimize
  left.product(right)
end