Class: Axiom::Optimizer::Relation::Operation::Binary::SortedRight

Inherits:
Axiom::Optimizer::Relation::Operation::Binary show all
Defined in:
lib/axiom/optimizer/relation/operation/binary.rb

Overview

Optimize when the right operand is an Sorted

Constant Summary

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 right operand is an Sorted

Returns:

  • (Boolean)


87
88
89
# File 'lib/axiom/optimizer/relation/operation/binary.rb', line 87

def optimizable?
  right.kind_of?(Axiom::Relation::Operation::Sorted)
end

#optimizeBinary

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.

Drop the Sorted and wrap the right operand

Returns:



96
97
98
# File 'lib/axiom/optimizer/relation/operation/binary.rb', line 96

def optimize
  operation.class.new(left, right.operand)
end