Class: Veritas::Optimizer::Relation::Operation::Binary::LeftOrderOperand

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

Overview

Optimize when the left operand is an Order

Constant Summary

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 left operand is an Order

Returns:

  • (Boolean)


64
65
66
# File 'lib/veritas/optimizer/relation/operation/binary.rb', line 64

def optimizable?
  left.kind_of?(Veritas::Relation::Operation::Order)
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 Order and wrap the left operand

Returns:



73
74
75
# File 'lib/veritas/optimizer/relation/operation/binary.rb', line 73

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